System.Collections.Async.AsyncEnumeratorWithState<TItem, TState>
public class AsyncEnumeratorWithState<TItem, TState> : CurrentValueContainer<TItem>, IAsyncEnumerator<TItem>, IAsyncEnumerator, IDisposable
Helps to enumerate items in a collection asynchronously.
Provides exactly the same functionality as AsyncEnumerator<T>,
but allows to pass a user state object in the enumeration function,
what can be used for performance optimization.
Gets the element in the collection at the current position of the enumerator
Tells if enumeration is complete. Returns True only after MoveNextAsync returns False.
A user state that gets passed into the enumeration function.
public AsyncEnumeratorWithState(Func<Yield<TItem>, TState, Task> enumerationFunction, TState state, Action<TState> onDispose = null)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources
Advances the enumerator to the next element of the collection asynchronously