public async Task <ActionResult <CodUf> > PostCodUf(CodUf codUf) { _context.CodUf.Add(codUf); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCodUf", new { id = codUf.Id }, codUf)); }
public async Task <IActionResult> PutCodUf(int id, CodUf codUf) { if (id != codUf.Id) { return(BadRequest()); } _context.Entry(codUf).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CodUfExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }