Beispiel #1
0
        public void AddDonut(Donut d)

        {
            if (context.catalog.products.ContainsKey(d.Id))
            {
                throw new Exception("No such Donut in our DONOT shop");
            }
            context.catalog.products.Add(d.Id, d);
        }
Beispiel #2
0
 public void UpdateDonutInfo(Donut D)
 {
     if (context.catalog.products.ContainsKey(D.Id))
     {
         context.catalog.products[D.Id].Name    = D.Name;
         context.catalog.products[D.Id].Price   = D.Price;
         context.catalog.products[D.Id].Filling = D.Filling;
         return;
     }
     throw new Exception("No such Donut in our DONOT shop");
 }
Beispiel #3
0
 public bool Equals(Donut other)
 {
     return(this.Id == other.Id & this.Name == other.Name);
 }