public async Task <ActionResult <DCoworkingOrder> > PostDCoworkingOrder(DCoworkingOrder dCoworkingOrder) { _context.DCoworkingOrders.Add(dCoworkingOrder); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDCoworkingOrder", new { id = dCoworkingOrder.id }, dCoworkingOrder)); }
public async Task <IActionResult> PutDCoworkingOrder(int id, DCoworkingOrder dCoworkingOrder) { if (id != dCoworkingOrder.id) { return(BadRequest()); } _context.Entry(dCoworkingOrder).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DCoworkingOrderExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }