using BeautySalonContracts.BindingModels; using BeautySalonContracts.ViewModels; namespace BeautySalonDatabaseImplement.Models { public class Employee { public int Id { get; set; } public string? Name { get; set; } public string? Surname { get; set; } public string? Login { get; set; } public string? Password { get; set; } public string? Phone { get; set; } public static Employee? Create(EmployeeBindingModel model) { if (model == null) { return null; } return new Employee { Id = model.Id, Name = model.Name, Surname = model.Surname, Login = model.Login, Password = model.Password, Phone = model.Phone, }; } public void Update(EmployeeBindingModel model) { if (model == null) { return; } Name = model.Name; Surname = model.Surname; Login = model.Login; Password = model.Password; Phone = model.Phone; } public EmployeeViewModel GetViewModel => new() { Id = Id, Name = Name, Surname = Surname, Login = Login, Password = Password, Phone = Phone }; } }