AsyncEnumerableExtensions
Ecng.Linq
Extension methods for IAsyncEnumerable.
メソッド
Cast``2
public static IAsyncEnumerable<TResult> Cast<TSource, TResult>(IAsyncEnumerable<TSource> source)
result = AsyncEnumerableExtensions.Cast(source)
Casts the elements of an IAsyncEnumerable to the specified type.
- source
- The IAsyncEnumerable that contains the elements to be cast.
戻り値: An IAsyncEnumerable that contains each element of the source sequence cast to the specified type.
Cast``2
public static IAsyncEnumerable<TResult> Cast<TSource, TResult>(IAsyncEnumerable<TSource> source, Func<TSource, TResult> converter)
result = AsyncEnumerableExtensions.Cast(source, converter)
Converts the elements of an IAsyncEnumerable to the specified type using a converter function.
- source
- The IAsyncEnumerable that contains the elements to be converted.
- converter
- A function to convert each element from to .
戻り値: An IAsyncEnumerable that contains each element of the source sequence converted to the specified type.
WhereWithPrevious``1
public static IAsyncEnumerable<TSource> WhereWithPrevious<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, TSource, bool> predicate)
result = AsyncEnumerableExtensions.WhereWithPrevious(source, predicate)
Filters a sequence of values based on a predicate that compares each element with its previous element. The first element is always included in the result.
- source
- An IAsyncEnumerable to filter.
- predicate
- A function to test each element against its previous element for a condition.
戻り値: An IAsyncEnumerable that contains elements from the input sequence where the predicate returns true when compared to the previous element.