public async Task <ActionResult> Ask(QuestionCreateRequest request, CancellationToken cancel) { var command = new QuestionCreateCommand(request.Title, request.Content, _markdown.TransformIntoHTML(request.Content), DateTime.Now, request.Tags); var result = await _mediator.ExecuteAsync <QuestionCreateCommand, QuestionCreateCommandResult>(command, User.GetAppIdentity(), cancel); return(RedirectToRoute("QuestionRead", new { id = result.Id, slug = result.Slug, action = "get" })); }
public async Task <ActionResult> Add(AnswerCreateRequest request, CancellationToken cancel) { var command = new AnswerCreateCommand(request.QuestionId, DateTime.Now, request.Content, _markdown.TransformIntoHTML(request.Content)); var result = await _mediator.ExecuteAsync <AnswerCreateCommand, AnswerCreateCommandResult>(command, User.GetAppIdentity(), cancel); return(Redirect(Url.RouteUrl("QuestionRead", new { id = result.QuestionId, slug = result.Slug, action = "get" }) + "#ans_" + result.AnswerId)); }