示例#1
0
        public JoinExpression(IEnumerableExpression <TOuter> outer, IEnumerable <TInner> inner, Expression <Func <TOuter, TKey> > outerKeySelector, Func <TOuter, TKey> outerKeySelectorCompiled, Expression <Func <TInner, TKey> > innerKeySelector, Func <TInner, TKey> innerKeySelectorCompiled, Expression <Func <TOuter, TInner, TResult> > resultSelector, Func <TOuter, TInner, TResult> resultSelectorCompiled, IEqualityComparer <TKey> comparer)
        {
            if (outer == null)
            {
                throw new ArgumentNullException("outer");
            }
            if (inner == null)
            {
                throw new ArgumentNullException("inner");
            }
            if (outerKeySelector == null)
            {
                throw new ArgumentNullException("outerKeySelector");
            }
            if (innerKeySelector == null)
            {
                throw new ArgumentNullException("innerKeySelector");
            }
            if (resultSelector == null)
            {
                throw new ArgumentNullException("resultSelector");
            }

            Source                   = outer;
            Inner                    = inner;
            OuterKeySelector         = outerKeySelector;
            OuterKeySelectorCompiled = outerKeySelectorCompiled ?? ExpressionCompileRewriter.Compile(outerKeySelector);
            InnerKeySelector         = innerKeySelector;
            InnerKeySelectorCompiled = innerKeySelectorCompiled ?? ExpressionCompileRewriter.Compile(innerKeySelector);
            ResultSelector           = resultSelector;
            ResultSelectorCompiled   = resultSelectorCompiled ?? ExpressionCompileRewriter.Compile(resultSelector);
            Comparer                 = comparer;
        }
示例#2
0
        public SelectExpression(IEnumerableExpression <TSource> source, Expression <Func <TSource, TResult> > selector, Func <TSource, TResult> selectorCompiled)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (selector == null)
            {
                throw new ArgumentNullException("selector");
            }
            if (selectorCompiled == null)
            {
                selectorCompiled = ExpressionCompileRewriter.Compile(selector);
            }

            Source             = source;
            SelectorExpression = selector;
            SelectorCompiled   = selectorCompiled;
        }
示例#3
0
        public WhereExpression(IEnumerableExpression <T> source, Expression <Func <T, bool> > predicate, Func <T, bool> predicateCompiled)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (predicate == null)
            {
                throw new ArgumentNullException("selector");
            }
            if (predicateCompiled == null)
            {
                predicateCompiled = ExpressionCompileRewriter.Compile(predicate);
            }

            Source = source;
            PredicateExpression = predicate;
            PredicateCompiled   = predicateCompiled;
        }
示例#4
0
        public GroupByExpression(IEnumerableExpression <TElement> source, Expression <Func <TElement, TKey> > keySelector, Func <TElement, TKey> keySelectorCompiled, IEqualityComparer <TKey> comparer)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (keySelector == null)
            {
                throw new ArgumentNullException("keySelector");
            }
            if (keySelectorCompiled == null)
            {
                keySelectorCompiled = ExpressionCompileRewriter.Compile(keySelector);
            }

            Source            = source;
            Predicate         = keySelector;
            PredicateCompiled = keySelectorCompiled;
            Comparer          = comparer ?? EqualityComparer <TKey> .Default;
        }
示例#5
0
        public SelectManyExpression(IEnumerableExpression <TSource> source, Expression <Func <TSource, IEnumerable <TIntermediate> > > func, Func <TSource, IEnumerable <TIntermediate> > funcCompiled, Expression <Func <TSource, TIntermediate, TResult> > resultSelector, Func <TSource, TIntermediate, TResult> resultSelectorCompiled)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (func == null)
            {
                throw new ArgumentNullException("func");
            }
            if (resultSelector == null)
            {
                throw new ArgumentNullException("resultSelector");
            }

            Source                 = source;
            FuncExpression         = func;
            FuncCompiled           = funcCompiled ?? ExpressionCompileRewriter.Compile(func);
            ResultSelector         = resultSelector;
            ResultSelectorCompiled = resultSelectorCompiled ?? ExpressionCompileRewriter.Compile(resultSelector);
        }