public void AddBaking(Baking d) { if (context.catalog.products.ContainsKey(d.Id)) { throw new Exception("No such baking in our shop"); } context.catalog.products.Add(d.Id, d); }
public void UpdateBakingInfo(Baking D) { if (context.catalog.products.ContainsKey(D.Id)) { context.catalog.products[D.Id].Price = D.Price; context.catalog.products[D.Id].Type = D.Type; return; } throw new Exception("No such baking in our shop"); }