AsyncLinqExtensions.

Filter<TSource>(IAsyncEnumerable<TSource>, Func<TSource, bool>) Method

Summary

Filters a sequence of values based on a predicate.

Syntax

public static IAsyncEnumerable<TSource> Filter<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, bool> predicate)

Type Parameters

Name Description
TSource The type of the elements of source.

Parameters

Name Type Description
source IAsyncEnumerable<TSource> An System.Collections.Generic.IAsyncEnumerable`1 to filter.
predicate Func<TSource, bool> A function to test each element for a condition.

Return Value

Type Description
IAsyncEnumerable<TSource> An System.Collections.Generic.IAsyncEnumerable`1 that contains elements from the input sequence that satisfy the condition.