public async Task <IActionResult> PutValue(int id, Value value) { if (id != value.ID) { return(BadRequest()); } _context.Entry(value).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ValueExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async System.Threading.Tasks.Task <T> Update(T entity) { _ctx.Entry(entity).State = Microsoft.EntityFrameworkCore.EntityState.Modified; await _ctx.SaveChangesAsync(); return(entity); }
public async void UpdateAsync(TEntity entity) { _context.Entry(entity).State = EntityState.Modified; await _context.SaveChangesAsync(); }