public async Task <IActionResult> PutEdoors(short id, Edoors edoors) { if (id != edoors.EdoorsId) { return(BadRequest()); } _context.Entry(edoors).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EdoorsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Edoors> > PostEdoors(Edoors edoors) { _context.Edoors.Add(edoors); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EdoorsExists(edoors.EdoorsId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEdoors", new { id = edoors.EdoorsId }, edoors)); }