public async Task <IActionResult> PutConfChildState([FromRoute] int id, [FromBody] ConfChildState confChildState) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != confChildState.Recid) { return(BadRequest()); } _context.Entry(confChildState).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConfChildStateExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostConfChildState([FromBody] ConfChildState confChildState) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.ConfChildState.Add(confChildState); await _context.SaveChangesAsync(); return(CreatedAtAction("GetConfChildState", new { id = confChildState.Recid }, confChildState)); }