using SchoolContracts.BindingModels; using SchoolContracts.Extensions; using SchoolContracts.ViewModels; using SchoolDataModels; using System.ComponentModel.DataAnnotations; namespace SchoolDatabaseImplement.Models { public class Implementer : IImplementerModel { public int Id { get; set; } [Required] public string FirstName { get; private set; } = string.Empty; [Required] public string LastName { get; private set; } = string.Empty; [Required] public string Login { get; private set; } = string.Empty; [Required] public string Password { get; private set; } = string.Empty; public string PhoneNumber { get; set; } = string.Empty; [Required] public List? Disciplines { get; private set; } public static Implementer Create(ImplementerBindingModel model) { return model.CastWithCommonProperties(); } public static implicit operator ImplementerViewModel?(Implementer? model) => model?.CastWithCommonProperties(); } }