public async Task <ActionResult> Index(ApprenticeshipSearchMode searchMode = ApprenticeshipSearchMode.Keyword) { return(await Task.Run <ActionResult>(() => { //Originally done in PopulateSortType ModelState.Remove("SortType"); var response = _apprenticeshipSearchMediator.Index(searchMode); return View(response.ViewModel); })); }
public async Task <ActionResult> Index(ApprenticeshipSearchMode searchMode = ApprenticeshipSearchMode.Keyword, bool reset = false) { return(await Task.Run <ActionResult>(() => { //Originally done in PopulateSortType ModelState.Remove("SortType"); var candidateId = UserContext == null ? default(Guid?) : UserContext.CandidateId; var response = _apprenticeshipSearchMediator.Index(candidateId, searchMode, reset); switch (response.Code) { case ApprenticeshipSearchMediatorCodes.Index.Ok: { ViewBag.ShowSearchTour = _helpCookieProvider.ShowSearchTour(HttpContext, candidateId); return View(response.ViewModel); } } throw new InvalidMediatorCodeException(response.Code); })); }