public async Task <ActionResult <TabpAntecedent> > PostTabpAntecedent(TabpAntecedent tabpAntecedent) { _context.TabpAntecedents.Add(tabpAntecedent); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTabpAntecedent", new { id = tabpAntecedent.AntcdnIdf }, tabpAntecedent)); }
public async Task <IActionResult> PutTabpAntecedent(int id, TabpAntecedent tabpAntecedent) { if (id != tabpAntecedent.AntcdnIdf) { return(BadRequest()); } _context.Entry(tabpAntecedent).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TabpAntecedentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }