Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 public async Task UpdateShelf(Shelf shelf)
 {
     context.Shelf.Update(shelf);
     await context.SaveChangesAsync();
 }
Exemplo n.º 3
0
 public async Task CreateShelf(Shelf shelf)
 {
     context.Shelf.Add(shelf);
     await context.SaveChangesAsync();
 }