The examples with await foreach do not show if ConfigureAwait can be used.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
That's a good question @lostmsu
@stephentoub Do you have guiidance here? Are there overloads that match the needed signatures?
It does make sense, and it can be used. But because the underlying tasks returned from MoveNextAsync and DisposeAsync aren't directly available, you employ ConfigureAwait using the ConfigureAwait extension method on IAsyncEnumerable<T>:
https://github.com/dotnet/corefx/blob/f9c848d6ad5415c1fa844f5403ea8ef78c408f9a/src/System.Threading.Tasks/ref/System.Threading.Tasks.cs#L78
e.g.
C#
await foreach (var item in source.ConfigureAwait(false))
{
...
}
Most helpful comment
It does make sense, and it can be used. But because the underlying tasks returned from MoveNextAsync and DisposeAsync aren't directly available, you employ ConfigureAwait using the ConfigureAwait extension method on
IAsyncEnumerable<T>:https://github.com/dotnet/corefx/blob/f9c848d6ad5415c1fa844f5403ea8ef78c408f9a/src/System.Threading.Tasks/ref/System.Threading.Tasks.cs#L78
e.g.
C# await foreach (var item in source.ConfigureAwait(false)) { ... }