public async Task <IActionResult> PutOrders(int id, Orders orders) { if (id != orders.OrderId) { return(BadRequest()); } _context.Entry(orders).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrdersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public TEntity Update(TEntity entity) { _bikeStoresContext.Entry(entity).State = EntityState.Modified; _bikeStoresContext.SaveChanges(); return(entity); }