public async Task <IActionResult> PutPFailDetail([FromRoute] int id, [FromBody] PFailDetail pFailDetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != pFailDetail.Id) { return(BadRequest()); } _context.Entry(pFailDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PFailDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostPFailDetail([FromBody] PFailDetail pFailDetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.PFailDetail.Add(pFailDetail); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPFailDetail", new { id = pFailDetail.Id }, pFailDetail)); }