public async Task <IActionResult> Putfloors([FromRoute] int id, [FromBody] floors floors) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != floors.id) { return(BadRequest()); } _context.Entry(floors).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!floorsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Postfloors([FromBody] floors floors) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.floors.Add(floors); await _context.SaveChangesAsync(); return(CreatedAtAction("Getfloors", new { id = floors.id }, floors)); }