Share via


QueryableExtensions.Take<TSource> Method

Definition

Returns a specified number of contiguous elements from the start of a sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Linq.IQueryable<TSource> Take<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<int>> countAccessor);
static member Take : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<int>> -> System.Linq.IQueryable<'Source>
<Extension()>
Public Function Take(Of TSource) (source As IQueryable(Of TSource), countAccessor As Expression(Of Func(Of Integer))) As IQueryable(Of TSource)

Type Parameters

TSource

The type of the elements of source.

Parameters

source
IQueryable<TSource>

The sequence to return elements from.

countAccessor
Expression<Func<Int32>>

An expression that evaluates to the number of elements to return.

Returns

IQueryable<TSource>

A sequence that contains the specified number of elements from the start of the input sequence.

Attributes

Applies to