public async Task <ActionResult <LineSurvey> > PostLineSurvey(LineSurvey lineSurvey) { _context.LineSurveys.Add(lineSurvey); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLineSurvey", new { id = lineSurvey.LineSurveyId }, lineSurvey)); }
public async Task <IActionResult> PutLineSurvey(int id, LineSurvey lineSurvey) { if (id != lineSurvey.LineSurveyId) { return(BadRequest()); } _context.Entry(lineSurvey).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LineSurveyExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }