AsyncEnumerable.TakeWhile Method (System.Linq) (original) (raw)

Definition

Namespace:

System.Linq

Assembly:

System.Linq.AsyncEnumerable.dll

Package:

System.Linq.AsyncEnumerable v10.0.0-preview.5.25277.114

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

TakeWhile(IAsyncEnumerable, Func<TSource,Boolean>) Returns elements from a sequence as long as a specified condition is true.
TakeWhile(IAsyncEnumerable, Func<TSource,Int32,Boolean>) Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.
TakeWhile(IAsyncEnumerable, Func<TSource,Int32,CancellationToken,ValueTask>) Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.
TakeWhile(IAsyncEnumerable, Func<TSource,CancellationToken,ValueTask>) Returns elements from a sequence as long as a specified condition is true.

TakeWhile(IAsyncEnumerable, Func<TSource,Boolean>)

Source:

TakeWhile.cs

Source:

TakeWhile.cs

Returns elements from a sequence as long as a specified condition is true.

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

Type Parameters

TSource

The type of the elements of source.

Parameters

predicate

Func<TSource,Boolean>

A function to test each element for a condition.

Returns

An IAsyncEnumerable that contains the elements from the input sequence that occur before the element at which the test no longer passes.

Exceptions

Applies to

TakeWhile(IAsyncEnumerable, Func<TSource,Int32,Boolean>)

Source:

TakeWhile.cs

Source:

TakeWhile.cs

Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.

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

Type Parameters

TSource

The type of the elements of source.

Parameters

predicate

Func<TSource,Int32,Boolean>

A function to test each element for a condition.

Returns

An IAsyncEnumerable that contains the elements from the input sequence that occur before the element at which the test no longer passes.

Exceptions

Applies to

TakeWhile(IAsyncEnumerable, Func<TSource,Int32,CancellationToken,ValueTask>)

Source:

TakeWhile.cs

Source:

TakeWhile.cs

Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IAsyncEnumerable<TSource> ^ TakeWhile(System::Collections::Generic::IAsyncEnumerable<TSource> ^ source, Func<TSource, int, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask<bool>> ^ predicate);
public static System.Collections.Generic.IAsyncEnumerable<TSource> TakeWhile<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,int,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<bool>> predicate);
static member TakeWhile : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, int, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<bool>> -> System.Collections.Generic.IAsyncEnumerable<'Source>
<Extension()>
Public Function TakeWhile(Of TSource) (source As IAsyncEnumerable(Of TSource), predicate As Func(Of TSource, Integer, CancellationToken, ValueTask(Of Boolean))) As IAsyncEnumerable(Of TSource)

Type Parameters

TSource

The type of the elements of source.

Parameters

Returns

An IAsyncEnumerable that contains the elements from the input sequence that occur before the element at which the test no longer passes.

Exceptions

Applies to

TakeWhile(IAsyncEnumerable, Func<TSource,CancellationToken,ValueTask>)

Source:

TakeWhile.cs

Source:

TakeWhile.cs

Returns elements from a sequence as long as a specified condition is true.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IAsyncEnumerable<TSource> ^ TakeWhile(System::Collections::Generic::IAsyncEnumerable<TSource> ^ source, Func<TSource, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask<bool>> ^ predicate);
public static System.Collections.Generic.IAsyncEnumerable<TSource> TakeWhile<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<bool>> predicate);
static member TakeWhile : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<bool>> -> System.Collections.Generic.IAsyncEnumerable<'Source>
<Extension()>
Public Function TakeWhile(Of TSource) (source As IAsyncEnumerable(Of TSource), predicate As Func(Of TSource, CancellationToken, ValueTask(Of Boolean))) As IAsyncEnumerable(Of TSource)

Type Parameters

TSource

The type of the elements of source.

Parameters

Returns

An IAsyncEnumerable that contains the elements from the input sequence that occur before the element at which the test no longer passes.

Exceptions

Applies to