public void IncreaseInStorage(int productId) { var storage = _wormDbContext.Store.FirstOrDefault(i => i.ProductId == productId); if (storage != null) { storage.Amount++; _wormDbContext.Update(storage); _wormDbContext.SaveChanges(); } }
public void ChangeOrderStatus(Order order, string state) { if (order != null) { order.Condidtion = state; _wormDbContext.Update(order); _wormDbContext.SaveChanges(); } }