public async Task <IActionResult> PutArea(int id, Area area) { if (id != area.Id) { return(BadRequest()); } _context.Entry(area).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AreaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task<IActionResult> PutHouse(int id, House house) { if (id != house.Id) { return BadRequest(); } _context.Entry(house).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HouseExists(id)) { return NotFound(); } else { throw; } } return NoContent(); }