Beispiel #1
0
 public void AddDrink(Drink drink)
 {
     using (DrinkContext db = new DrinkContext())
     {
         try
         {
             db.Drinks.Add(drink);
             db.SaveChanges();
         }
         catch (Exception e)
         { Console.WriteLine(e.ToString()); }
     }
 }
Beispiel #2
0
 public void AddReview(Review review)
 {
     using (DrinkContext db = new DrinkContext())
     {
         try
         {
             db.Reviews.Add(review);
             db.SaveChanges();
         }
         catch (Exception e)
         { Console.WriteLine(e.ToString()); }
     }
 }
Beispiel #3
0
 public void AddStore(CoffeeStore cs)
 {
     using (DrinkContext db = new DrinkContext())
     {
         try
         {
             db.CoffeeStores.Add(cs);
             db.SaveChanges();
         }
         catch (Exception e)
         { Console.WriteLine(e.ToString()); }
     }
 }