public async Task <IActionResult> Edit(AnswerCrudModel model) { if (!ModelState.IsValid) { return(this.RedirectToAction(nameof(Index), new { id = model.QuestionId })); } await this.answers.EditAsync(model.Id, model.Content, this.GetUserId()); return(this.RedirectToAction(nameof(Index), new { id = model.QuestionId })); }
public async Task <IActionResult> Delete(AnswerCrudModel model) { await this.answers.DeleteAsync(model.Id, this.GetUserId()); return(this.RedirectToAction(nameof(Index), new { id = model.QuestionId })); }