public async Task <IActionResult> PostTrMgDel([FromBody] TrMgDel trMgDel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.TrMgDel.Add(trMgDel); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TrMgDelExists(trMgDel.MkTrId)) { return(new StatusCodeResult(StatusCodes.Status409Conflict)); } else { throw; } } return(CreatedAtAction("GetTrMgDel", new { id = trMgDel.MkTrId }, trMgDel)); }
public async Task <IActionResult> PutTrMgDel([FromRoute] int id, [FromBody] TrMgDel trMgDel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != trMgDel.MkTrId) { return(BadRequest()); } _context.Entry(trMgDel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TrMgDelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }