public int Create(Customer customer) { context.Customer.Add(customer); context.Entry(customer).Reload(); context.SaveChanges(); return(customer.CustomerId); }
public void UpdateInventory(int InventoryID, int quantity) { var update = context.Inventory.Find(InventoryID); update.InventoryCount -= quantity; context.SaveChanges(); }
public void RemoveOrderItem(OrderLine item) { context.OrderLine.Remove(item); context.SaveChanges(); }