Example #1
0
 static void AddStore(Drink drink) //to add drinks into db
 {
     using (DrinkContext db = new DrinkContext())
     {
         try
         {
             db.Drinks.Add(drink);
             db.SaveChanges();
         }
         catch (Exception e)
         { Console.WriteLine(e.ToString()); }
     }
 }
Example #2
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()); }
     }
 }