public async Task <IActionResult> PutAnswer(int id, Answer answer) { if (id != answer.AnswerId) { return(BadRequest()); } _context.Entry(answer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AnswerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutQuestion(int id, Question question) { if (id != question.QuestionId) { return(BadRequest()); } _context.Entry(question).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!QuestionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }