Advertisement
Guest User

Untitled

a guest
Jul 27th, 2020
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1.         public async Task Change(string userId, WareHouse wareHouse)
  2.         {
  3.             var wh = _context.WareHouses.Where(user => user.UserId == userId).First(wh => wh.Id == wareHouse.Id);
  4.             if (wh != null)
  5.             {
  6.                 wareHouse.OnChange(userId);
  7.                 wh = wareHouse;
  8.                 await _context.SaveChangesAsync();
  9.             }
  10.             else
  11.             {
  12.                 throw new EntityException("Warehouse not found");
  13.             }
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement