using SchoolContracts.BindingModels; using SchoolContracts.ViewModels; using SchoolDataModels; using System.ComponentModel.DataAnnotations; using SchoolContracts.Extensions; namespace SchoolDatabaseImplement.Models { public class Executor : IExecutorModel { public int Id { get; private 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? Students { get; private set; } [Required] public List? Requirements { get; private set; } public static Executor Create(ExecutorBindingModel model) => model.CastWithCommonProperties(); public static implicit operator ExecutorViewModel?(Executor? model) => model?.CastWithCommonProperties(); } }