public async Task <IActionResult> PutItem(int id, Item item) { if (id != item.Id) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public Task <int> SaveChangesAsync() { return(_context.SaveChangesAsync()); }