public async Task <IActionResult> PostMThrmscandidateEntry([FromBody] MThrmscandidateEntry mThrmscandidateEntry) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MThrmscandidateEntry.Add(mThrmscandidateEntry); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMThrmscandidateEntry", new { id = mThrmscandidateEntry.MThrmscandidateEntryId }, mThrmscandidateEntry)); }
public async Task <IActionResult> PutMThrmscandidateEntry([FromRoute] long id, [FromBody] MThrmscandidateEntry mThrmscandidateEntry) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mThrmscandidateEntry.MThrmscandidateEntryId) { return(BadRequest()); } _context.Entry(mThrmscandidateEntry).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MThrmscandidateEntryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }