public async Task <IActionResult> PutSurveyOperators([FromRoute] int id, [FromBody] SurveyOperators surveyOperators) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != surveyOperators.SurveyOperatorsID) { return(BadRequest()); } _context.Entry(surveyOperators).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SurveyOperatorsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostSurveyOperators([FromBody] SurveyOperators surveyOperators) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.SurveyOperators.Add(surveyOperators); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSurveyOperators", new { id = surveyOperators.SurveyOperatorsID }, surveyOperators)); }