using BeautySaloonContracts.BindingModels; using BeautySaloonContracts.ViewModels; using BeautySaloonDataModels; using System; using System.Collections.Generic; namespace BeautySaloonDatabaseImplement; /// /// Сущность услуги /// public partial class Service : IServiceModel { /// /// Уникальный идентификатор /// public int Id { get; set; } /// /// Название /// public string Name { get; set; } = null!; /// /// Цена /// public decimal Price { get; set; } public virtual ServiceOrder? ServiceOrder { get; set; } public static Service Create(ServiceBindingModel model) { return new Service() { Id = model.Id, Name = model.Name, Price = model.Price }; } public void Update(ServiceBindingModel model) { Name = model.Name; Price = model.Price; } public ServiceViewModel GetViewModel => new() { Id = Id, Name = Name, Price = Price }; }