public async Task <ActionResult <DCoworking> > PostDCoworking(DCoworking dCoworking) { _context.DCoworkings.Add(dCoworking); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDCoworking", new { id = dCoworking.id }, dCoworking)); }
public async Task <IActionResult> PutDCoworking(int id, DCoworking dCoworking) { if (id != dCoworking.id) { return(BadRequest()); } _context.Entry(dCoworking).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DCoworkingExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }