コード例 #1
0
 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)
                    )));
 }
コード例 #2
0
        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))));
        }