예제 #1
0
        /// <summary>
        /// Shows "Kartløsninger". Contains metadata of type "Application"
        /// </summary>
        /// <param name="parameters"></param>
        /// <returns>/kartlosninger</returns>
        public ActionResult Index(SearchParameters parameters)
        {
            parameters.AddComplexFacetsIfMissing();
            SearchResult searchResult = _applicationService.Applications(parameters);

            SearchViewModel model = new SearchViewModel(parameters, searchResult);

            model.EnabledFacets = model.FacetApplications();

            return(View(model));
        }
예제 #2
0
        public SearchResult applications([System.Web.Http.ModelBinding.ModelBinder(typeof(SM.General.Api.FieldValueModelBinder))] SearchParameters parameters)
        {
            try
            {
                if (parameters == null)
                {
                    parameters = new SearchParameters();
                }

                Models.SearchParameters searchParameters = CreateSearchParameters(parameters);
                searchParameters.AddDefaultFacetsIfMissing();
                Models.SearchResult searchResult = _applicationService.Applications(searchParameters);

                var urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext);

                return(new SearchResult(searchResult, urlHelper));
            }
            catch (Exception ex)
            {
                Log.Error("Error API", ex);
                return(null);
            }
        }