public async Task <IActionResult> PutWaiverCaption([FromRoute] int id, [FromBody] WaiverCaption waiverCaption) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != waiverCaption.AutoId) { return(BadRequest()); } _context.Entry(waiverCaption).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WaiverCaptionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostWaiverCaption([FromBody] WaiverCaption waiverCaption) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.WaiverCaption.Add(waiverCaption); await _context.SaveChangesAsync(); return(CreatedAtAction("GetWaiverCaption", new { id = waiverCaption.AutoId }, waiverCaption)); }