public async Task <ActionResult <PropostaSeguro> > PostPropostaSeguro(PropostaSeguro propostaSeguro) { _context.PropostaSeguro.Add(propostaSeguro); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPropostaSeguro", new { id = propostaSeguro.IdPropostaSeguro }, propostaSeguro)); }
public async Task <IActionResult> PutPropostaSeguro(int id, PropostaSeguro propostaSeguro) { if (id != propostaSeguro.IdPropostaSeguro) { return(BadRequest()); } _context.Entry(propostaSeguro).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PropostaSeguroExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }