internal void AddNewOrderedMeal(tblMealOrder mealOrder) { using (var conn = new PizzaRestaurantEntities()) { conn.tblMealOrders.Add(mealOrder); conn.SaveChanges(); } }
internal void DeleteOrderedMeal(tblMealOrder mealOrder) { using (var context = new PizzaRestaurantEntities()) { var orderToRemove = context.tblMealOrders.FirstOrDefault(e => e.MealOrderID == mealOrder.MealOrderID); if (orderToRemove != null) { context.tblMealOrders.Remove(orderToRemove); context.SaveChanges(); } } }