using ComputerStoreDataModels.Models; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ComputerStoreContracts.BindingModels { public class PCBindingModel : IPCModel { public int ID {get; set;} public string Name { get; set; } = string.Empty; public double Price { get; set; } public int EmployeeID { get; set; } public int RequestID { get; set; } public Dictionary PCComponents { get; set; } = new(); [JsonConstructor] public PCBindingModel(Dictionary PCComponents) { this.PCComponents = PCComponents.ToDictionary(x => x.Key, x => (x.Value.Component as IComponentModel, x.Value.Quantity)); } public PCBindingModel() { } } }