using BeautySaloonDataModels; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace BeautySaloonDatabaseImplement.Models { public class Order : IOrderModel { public int Id { get; set; } [Required] public DateTime Date { get; set; } [Required] public double Sum { get; set; } [Required] public int ClientId { get; set; } [Required] public int EmployeeId { get; set; } private Dictionary? _orderServices = null; [ForeignKey("OrderId")] public virtual List Services { get; set; } = new(); [NotMapped] public Dictionary OrderServices { get { /*if (_orderServices == null) { _orderServices = Services .ToDictionary(recPC => recPC.ServiceId, recPC => (recPC.Service as IServiceModel, recPC.Count)); }*/ return _orderServices; } } } }