protected virtual void ConfigureQuery(TQuery query, PagedListConfigModel model)
        {
            query.PageSize   = model.Pagging.PageSize;
            query.PageNumber = model.Pagging.RequestedPageNumber;

            if (model.Sorting.HasSorting)
            {
                query.AddSorting(model.Sorting.SortByValue ? ValueFieldName : DescriptionFieldName, model.Sorting.SortingOrder == PagedListSortOrder.Desc);
            }


            if (model.Filtering.HasFiltering && model.Filtering.FilterValue != null)
            {
                var strVal = model.Filtering.FilterValue as string;

                if (strVal == null || strVal.Length >= model.Filtering.MinFilterSize)
                {
                    query.AddFiltering(
                        model.Filtering.FilterByValue ? ValueFieldName : DescriptionFieldName,
                        model.Filtering.FilterValue, ConvertCriterion(model.Filtering.FilteringMode),
                        !model.Filtering.FilterCaseSensitive
                        );
                }
            }
        }
        public DataPage <PagedListItem> FetchPage(PagedListConfigModel model)
        {
            var q = new TQuery();

            ConfigureQuery(q, model);
            TResult pageOfData = QueryData(q);

            var staticItems = GetStaticItems(model, q);;
            var res         = pageOfData.Data.Select(ListItemFromDataItem);

            return(new DataPage <PagedListItem>()
            {
                Data = (staticItems != null && staticItems.Count > 0 ? staticItems.Union(res) : res).ToList(),
                TotalRecordsCount = pageOfData.TotalRecordsCount,
                PageNumber = pageOfData.PageNumber,
                TotalPages = pageOfData.TotalPages
            });
        }
 protected virtual IList <PagedListItem> GetStaticItems(PagedListConfigModel m, TQuery q)
 {
     return(null);
 }