Queryable.SkipLast<TSource>(IQueryable<TSource>, Int32) 方法

定义

返回一个新的可查询序列,它包含 source 中的元素,但省略了源可查询序列中的 count 个元素。Returns a new queryable sequence that contains the elements from source with the last count elements of the source queryable sequence omitted.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::IQueryable<TSource> ^ SkipLast(System::Linq::IQueryable<TSource> ^ source, int count);
public static System.Linq.IQueryable<TSource> SkipLast<TSource> (this System.Linq.IQueryable<TSource> source, int count);
static member SkipLast : System.Linq.IQueryable<'Source> * int -> System.Linq.IQueryable<'Source>
<Extension()>
Public Function SkipLast(Of TSource) (source As IQueryable(Of TSource), count As Integer) As IQueryable(Of TSource)

类型参数

TSource

可查询序列中的元素的类型。The type of the elements in the queryable sequence.

参数

source
IQueryable<TSource>

可查询的序列。A queryable sequence.

count
Int32

从可查询序列末尾起省略的元素数。The number of elements to omit from the end of the queryable sequence.

返回

IQueryable<TSource>

一个新的可查询序列,它包含 source 中的元素,但从可查询序列末尾算起要减去 count 个元素。A new queryable sequence that contains the elements from source minus count elements from the end of the queryable sequence.

例外

sourcenullsource is null.

注解

如果 count 不是正数,则此方法返回 source 可查询序列的相同副本。If count is not a positive number, this method returns an identical copy of the source queryable sequence.

适用于