示例#1
0
 public ModelFilter(Linq2ODataSettings settings, Expression <Func <T, bool> > filterExpression, Expression <Func <T, object> > selectExpression, IEnumerable <SortDescription <T> > sortDescriptions, int skip, int top)
 {
     _settings         = settings;
     _skip             = skip;
     _top              = top;
     _filterExpression = filterExpression;
     _selectExpression = selectExpression;
     _sortDescriptions = sortDescriptions ?? Enumerable.Empty <SortDescription <T> >();
 }
 public static IQueryable <object> Filter <T>(this IEnumerable <T> source, string filter, Linq2ODataSettings settings)
 {
     return(Filter(source, new Dictionary <string, string>()
     {
         { StringConstants.FilterParameter, filter }
     }));
 }
        public static IQueryable <object> Filter <T>(this IEnumerable <T> source, IEnumerable <KeyValuePair <string, string> > query, Linq2ODataSettings settings)
        {
            var parser = new ParameterParser <T>(settings);

            return(Filter(source, parser.Parse(query)));
        }