Пример #1
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()); }
     }
 }
Пример #2
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()); }
     }
 }
Пример #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()); }
     }
 }
Пример #4
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()); }
     }
 }
Пример #5
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()); }
     }
 }
Пример #6
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()); }
     }
 }