コード例 #1
0
 public FilterSupporter(IEnumerable <T> data, NeedDataSourceEventArgs args)
 {
     this.util = new FilterUtility <T>(data, args);
 }
コード例 #2
0
        public static ItemsRequestedResult <NeedDataSourceEventArgs> ProcessAlreadyFiltered <T, TOrderBy>(NeedDataSourceEventArgs args, IEnumerable <T> results, Func <T, TOrderBy> orderbyDefault)
        {
            var count = results.Count();

            var itemsResult = new ItemsRequestedResult <NeedDataSourceEventArgs>()
            {
                request = args
            };

            if (results != null && results.Count() > 0)
            {
                itemsResult.isSuccessull = true;
                itemsResult.DataSetCount = count;
                results            = results.Skip(args.skip).Take(args.take);
                itemsResult.Result = results.ToList <T>();
            }
            else
            {
                itemsResult.isSuccessull = false;
                itemsResult.Result       = new List <T>();
                itemsResult.DataSetCount = 0;
            }
            return(itemsResult);
        }
コード例 #3
0
 public FilterUtility(IEnumerable <T> entity, NeedDataSourceEventArgs needDataSourceEventArgs)
 {
     Entity = entity;
     NeedDataSourceEventArgs = needDataSourceEventArgs;
     finalResult             = new { entity }.entity;
 }