private void VisitSkip(Expression skipValue) { if (_skipTranslator != null) { throw new NotSupportedException("You cannot have more than 1 Take/Skip/First/FirstOrDefault in the expression"); } _skipTranslator = new SkipTranslator(); _skipTranslator.Translate(skipValue); }
public Skip() { Func <IQueryable <TSource>, int, IQueryable <TSource> > f = Queryable.Skip; Func <IEnumerable <TSource>, int, IEnumerable <TSource> > f2 = Enumerable.Skip; var translator = new SkipTranslator(); AddTranslator(f.Method, translator); AddTranslator(f2.Method, translator); Func <IQueryable <TSource>, Expression <Func <TSource, bool> >, IQueryable <TSource> > f3 = Queryable.SkipWhile; Func <IEnumerable <TSource>, Func <TSource, bool>, IEnumerable <TSource> > f4 = Enumerable.SkipWhile; var translatorWithLambda = new SimpleMethodWithLambdaTranslator(); AddTranslator(f3.Method, translatorWithLambda); AddTranslator(f4.Method, translatorWithLambda); }