public async Task <ActionResult <CatAseguradoras> > PostCatAseguradoras(CatAseguradoras catAseguradoras) { _context.CatAseguradoras.Add(catAseguradoras); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCatAseguradoras", new { id = catAseguradoras.IdAseguradora }, catAseguradoras)); }
public async Task <IActionResult> PutCatAseguradoras(int id, CatAseguradoras catAseguradoras) { if (id != catAseguradoras.IdAseguradora) { return(BadRequest()); } _context.Entry(catAseguradoras).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CatAseguradorasExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }