AsyncEnumerable.Take メソッド

定義

オーバーロード

名前 説明
Take<TSource>(IAsyncEnumerable<TSource>, Int32)

シーケンスの先頭から指定した数の連続する要素を返します。

Take<TSource>(IAsyncEnumerable<TSource>, Range)

シーケンスから指定した連続する要素の範囲を返します。

Take<TSource>(IAsyncEnumerable<TSource>, Int32)

ソース:
Take.cs
ソース:
Take.cs
ソース:
Take.cs

シーケンスの先頭から指定した数の連続する要素を返します。

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

型パラメーター

TSource

ソースの要素の型。

パラメーター

source
IAsyncEnumerable<TSource>

要素を返すシーケンス。

count
Int32

返す要素の数。

返品

IAsyncEnumerable<TSource>

入力シーケンスの先頭から指定した数の要素を含む IAsyncEnumerable<T>

例外

sourcenullです。

適用対象

Take<TSource>(IAsyncEnumerable<TSource>, Range)

ソース:
Take.cs
ソース:
Take.cs
ソース:
Take.cs

シーケンスから指定した連続する要素の範囲を返します。

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IAsyncEnumerable<TSource> ^ Take(System::Collections::Generic::IAsyncEnumerable<TSource> ^ source, Range range);
public static System.Collections.Generic.IAsyncEnumerable<TSource> Take<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Range range);
static member Take : System.Collections.Generic.IAsyncEnumerable<'Source> * Range -> System.Collections.Generic.IAsyncEnumerable<'Source>
<Extension()>
Public Function Take(Of TSource) (source As IAsyncEnumerable(Of TSource), range As Range) As IAsyncEnumerable(Of TSource)

型パラメーター

TSource

sourceの要素の型。

パラメーター

source
IAsyncEnumerable<TSource>

要素を返すシーケンス。

range
Range

開始インデックスと終了インデックスを含む、返す要素の範囲。

返品

IAsyncEnumerable<TSource>

IAsyncEnumerable<T> シーケンスの要素の指定したrangeを含むsource

例外

sourcenullです。

注釈

このメソッドは、遅延実行を使用して実装されます。 即時戻り値は、アクションの実行に必要なすべての情報を格納するオブジェクトです。 このメソッドによって表されるクエリは、オブジェクトが 'GetEnumerator' メソッドを直接呼び出すか、Visual C# で 'foreach' を使用するか、Visual Basicの 'For Each' を使用して列挙されるまで実行されません。

Take source を列挙し、インデックスが指定した rangeに属する要素を生成します。

適用対象