public async Task <ActionResult <EsSerialActive> > PostEsSerialActive(EsSerialActive esSerialActive) { _context.EsSerialActive.Add(esSerialActive); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEsSerialActive", new { id = esSerialActive.id }, esSerialActive)); }
public async Task <IActionResult> PutEsSerialActive(int id, EsSerialActive esSerialActive) { if (id != esSerialActive.id) { return(BadRequest()); } _context.Entry(esSerialActive).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EsSerialActiveExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }