// ReSharper disable once InconsistentNaming

        public SearchContext(
            ISearchAspect <ID> path,
            ISearchAspect <FeaturedOption> featuredOption,
            ISearchAspect <ISortOrderOption> sortBy,
            ISearchAspect <int> pageSize,
            ISearchAspect <int> pageNumber,
            ISearchAspect <string> query,
            ISearchAspect <IEnumerable <string> > selectedFacetValues,
            ISearchAspect <SearchOperator> selectedFacetValuesSearchOperator,
            ISearchAspect <IEnumerable <ID> > excludedItemIds,
            ISearchAspect <IEnumerable <string> > excludedFacetValues,
            ISearchAspect <IEnumerable <ID> > selectedTemplateIds,

            int[] validPageSizes,
            CollectionSettings settings,
            ISortOptionRepository sortOptionRepository)
        {
            _validPageSizes       = validPageSizes;
            _sortOptionRepository = sortOptionRepository;

            CollectionSettings = settings;

            Path                = path;
            Featured            = featuredOption;
            SortBy              = sortBy;
            PageSize            = pageSize;
            PageNumber          = pageNumber;
            Query               = query;
            SelectedFacetValues = selectedFacetValues;
            SelectedFacetValuesSearchOperator = selectedFacetValuesSearchOperator;
            ExcludedItemIds     = excludedItemIds;
            ExcludedFacetValues = excludedFacetValues;
            SelectedTemplateIds = selectedTemplateIds;
        }
        public HttpRequestSearchContext(HttpRequestBase request, FacetValueValidator facetValueValidator, CollectionSettings settings, ISortOptionRepository sortOptionRepository)
        {
            _request = request;

            var context = ToNameValueCollection(request);

            // decorated object
            _inner = new SearchContext(
                new ItemIdAspect(keys.Path, settings.CollectionSource?.ID),
                new FeaturedAspect(keys.Featured, context.GetValueOrDefault(keys.Featured)),
                new SortOrderOptionAspect(keys.Sort, context.GetValueOrDefault(keys.Sort), settings.DefaultSortOrderOption, sortOptionRepository),
                new PageSizeAspect(keys.PageSize, context.GetValueOrDefault(keys.PageSize), Constants.SearchContext.ValidPageSizes),
                new PageNumberAspect(keys.PageNumber, context.GetValueOrDefault(keys.PageNumber)),
                new QueryAspect(keys.Query, context.GetValueOrDefault(keys.Query)),
                new FacetValuesAspect(keys.Facets, context.GetValueOrDefault(keys.Facets), facetValueValidator),
                new SearchOperatorAspect(keys.FacetOperator, context.GetValueOrDefault(keys.FacetOperator)),
                new ItemIdsAspect(keys.ExcludedItems, context.GetValueOrDefault(keys.ExcludedItems)),
                new FacetValuesAspect(keys.ExcludedFacets, context.GetValueOrDefault(keys.ExcludedFacets), facetValueValidator),
                new ItemIdsAspect(keys.Templates, context.GetValueOrDefault(keys.Templates)),

                Constants.SearchContext.ValidPageSizes,
                settings,
                sortOptionRepository
                );
        }