コード例 #1
0
        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 }));
        }
コード例 #2
0
        public async Task <IActionResult> Delete(AnswerCrudModel model)
        {
            await this.answers.DeleteAsync(model.Id, this.GetUserId());

            return(this.RedirectToAction(nameof(Index), new { id = model.QuestionId }));
        }