public async Task <IActionResult> PutCitizenship([FromRoute] long id, [FromBody] Citizenship citizenship) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != citizenship.IdRecordCitizenship) { return(BadRequest()); } _context.Entry(citizenship).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CitizenshipExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutRegistrationType([FromRoute] int id, [FromBody] RegistrationType registrationType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != registrationType.IdTypeRegistration) { return(BadRequest()); } _context.Entry(registrationType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RegistrationTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPerson([FromRoute] long id, [FromBody] Person person) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != person.Id) { return(BadRequest()); } _context.Entry(person).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutStreet([FromRoute] int id, [FromBody] Street street) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != street.IdStreet) { return(BadRequest()); } _context.Entry(street).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StreetExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutHouseInfo([FromRoute] int id, [FromBody] HouseInfo houseInfo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != houseInfo.IdDw) { return(BadRequest()); } _context.Entry(houseInfo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HouseInfoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }