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

定義

傳回新的可查詢序列,其包含移除來源可查詢序列最後 count 元素的所有 source 元素。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>

新的可查詢序列,其包含減去可查詢序列末端 count 元素的所有 source 元素。A new queryable sequence that contains the elements from source minus count elements from the end of the queryable sequence.

例外狀況

sourcenullsource is null.

備註

如果不是 count 正數,這個方法會傳回可查詢序列的相同複本 sourceIf count is not a positive number, this method returns an identical copy of the source queryable sequence.

適用於