Omikron.FactFinder.Data.SearchParameters.SearchParameters C# (CSharp) Method

SearchParameters() public method

public SearchParameters ( NameValueCollection parameters ) : System
parameters System.Collections.Specialized.NameValueCollection
return System
        public SearchParameters(NameValueCollection parameters)
        {
            Query = parameters["query"] ?? "";
            SeoPath = parameters["seoPath"] ?? "";
            ProductsPerPage = Int32.Parse(parameters["productsPerPage"] ?? "-1");
            CurrentPage = Int32.Parse(parameters["page"] ?? "1");
            FollowSearch = Int32.Parse(parameters["followSearch"] ?? "0");
            IsNavigation = parameters["catalog"] == "true";

            Filters = new Dictionary<string, string>();
            Sortings = new Dictionary<string, string>();

            foreach (string key in parameters)
            {
                string value = parameters[key];
                if (key.StartsWith("filter"))
                {
                    Filters[key.Substring("filter".Length)] = value;
                }
                else if (key.StartsWith("sort") && (value == "asc" || value == "desc"))
                {
                    Sortings[key.Substring("sort".Length)] = value;
                }
            }

            var config = ConnectionSection.GetSection();
            Channel = config.Channel;
        }
    }
SearchParameters