public async Task <IActionResult> PostRangeQualification([FromBody] RangeQualification rangeQualification) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.RangeQualification.Add(rangeQualification); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (RangeQualificationExists(rangeQualification.Id)) { return(new StatusCodeResult(StatusCodes.Status409Conflict)); } else { throw; } } return(CreatedAtAction("GetRangeQualification", new { id = rangeQualification.Id }, rangeQualification)); }
public async Task <IActionResult> PutRangeQualification([FromRoute] int id, [FromBody] RangeQualification rangeQualification) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != rangeQualification.Id) { return(BadRequest()); } _context.Entry(rangeQualification).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RangeQualificationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }