Ejemplo n.º 1
0
        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);
            }));
        }
Ejemplo n.º 2
0
        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);
            }));
        }