public async Task <IActionResult> PresenterView(string handle, string slug, CancellationToken ct) { var user = User.FindFirst(ShtikClaimTypes.Handle)?.Value; if (!handle.Equals(user, StringComparison.OrdinalIgnoreCase)) { return(NotFound()); } var(show, questions) = await MultiTask.WhenAll(_shows.Get(user, slug, ct), _questions.GetQuestionsForShow(user, slug, ct)); if (show == null) { return(NotFound()); } var viewModel = new PresenterViewModel { Show = show, Questions = questions.OrderByDescending(q => q.Time).ToList() }; return(View(viewModel)); }
public async Task <IActionResult> Get(string presenter, string slug, CancellationToken ct) { var questions = await _questions.GetQuestionsForShow(presenter, slug, ct).ConfigureAwait(false); return(Ok(questions ?? new List <Question>())); }