public static void UpdateOrder(int orderId, string size, string chilli, string salt, string pepper) { using (ShopOrders entities = new ShopOrders()) { Order order = entities.Orders.Where(p => p.OrderID == orderId).First <Order>(); order.Size = size; order.Chilli = chilli; order.MoreSalt = salt; order.Pepper = pepper; entities.SaveChanges(); } }
public static void AddOrder(string user, int foodID, string foodname, string size, string chilli, string salt, string pepper) { using (ShopOrders entities = new ShopOrders()) { Order order = new Order { Username = user, Size = size, FoodID = foodID, Chilli = chilli, MoreSalt = salt, Pepper = pepper }; entities.Orders.Add(order); entities.SaveChanges(); } }