This package was not created by Microsoft but the source code used to compile the assembly contained within it was written by Microsoft employees. I hope I haven't caused any drama or broken any laws, but when C# 8 Beta was released alongside Visual Studio 2019 Preview 1, on the December 4th 2018, writing async iterators and consuming them wasn't possible even though it could have been. The compiler was missing two types: ManualResetValueTaskSourceLogic<T> and IStrongBox<T> which I found here: https://gist.github.com/jcouv/ae7800985e3a8700bb84c6650d25bb69 and put in this nuget package within their designated namespaces. Adding this nuget package will allow you to use C# 8 Beta and write async iterators (methods which generate IAsyncEnumerable<T>). Furthermore the bug around enumerators ending after two iterations if you're inside an async iterator method can be resolved by turning your foreach statement into an await foreach statement and applying the thin wrapper .ToAsync() on the target enumerable (which will only allocate 2 class instances, one for the call itself and one for the enumeration itself).
License
—
Deps
0
Install Size
—
Vulns
✓ 0
Published
Dec 7, 2018
$ dotnet add package CSharp8Beta.AsyncIteratorPrerequisites.UnofficialNo README available.