public async Task <ActionResult <Civils> > PostCivils(Civils civils) { _context.Civils.Add(civils); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCivils", new { id = civils.Id }, civils)); }
public async Task <IActionResult> PutCivils(int id, Civils civils) { if (id != civils.Id) { return(BadRequest()); } _context.Entry(civils).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CivilsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }