public static TSource ElementAt <TSource>(this IQueryable <TSource> source, Index index) { if (source == null) { // throw Error.ArgumentNull(nameof(source)); throw new ArgumentNullException(nameof(source)); } return(source.Provider.Execute <TSource>( Expression.Call( null, CachedReflectionInfo.ElementAt_TSource_2(typeof(TSource)), source.Expression, Expression.Constant(index) ))); }
public static IQueryable <TSource> Slice <TSource>(this IQueryable <TSource> source, Range range) { if (source == null) { // throw Error.ArgumentNull(nameof(source)); throw new ArgumentNullException(nameof(source)); } return(source.Provider.CreateQuery <TSource>( Expression.Call( null, CachedReflectionInfo.Slice_TSource_2(typeof(TSource)), source.Expression, Expression.Constant(range)))); }