Example #1
0
 /// <summary>
 /// Creates a query that returns a specified number of contiguous elements from the start of a sequence.
 /// </summary>
 /// <typeparam name="TSource">The type of the elements of source.</typeparam>
 /// <param name="query">The query to return elements from.</param>
 /// <param name="count">The number of elements to return.</param>
 /// <returns>A query that returns a sequence containing the specified number of elements from the start of the input sequence.</returns>
 public static IQueryExpr <IEnumerable <TSource> > Take <TSource>(this IQueryExpr <IEnumerable <TSource> > query, int count)
 {
     return(new QueryExpr <IEnumerable <TSource> >(QExpr.NewTake(Expression.Constant(count), query.Expr)));
 }