public async Task UpdateShelf(Shelf shelf) { var shelfToUpdate = Shelves.FirstOrDefault(x => x.Symbol == shelf.Symbol); shelfToUpdate.QuantityInStock = shelf.QuantityInStock; shelfToUpdate.Price = shelf.Price; shelfToUpdate.Name = shelf.Name; context.Shelf.Update(shelfToUpdate); await context.SaveChangesAsync(); }
public async Task UpdateShelf(Shelf shelf) { context.Shelf.Update(shelf); await context.SaveChangesAsync(); }
public async Task CreateShelf(Shelf shelf) { context.Shelf.Add(shelf); await context.SaveChangesAsync(); }