Exemple #1
0
        public QueryStringSortSettings(IQueryDictionary <StringValues> query)
        {
            if (query == null)
            {
                throw new ArgumentException("No http context here!");
            }
            Query = query;
            ColumnQueryParameterName    = DefaultColumnQueryParameter;
            DirectionQueryParameterName = DefaultDirectionQueryParameter;

            var sortings = query.Get(ColumnOrderValue.DefaultSortingQueryParameter);

            if (sortings.Count > 0)
            {
                foreach (string sorting in sortings)
                {
                    ColumnOrderValue column = QueryDictionary <StringValues> .CreateColumnData(sorting);

                    if (column != ColumnOrderValue.Null)
                    {
                        _sortValues.Add(column);
                    }
                }
            }
        }