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