I need to stream a file from ASP.NET Core to Blazor WASM using gRPC.
I would like to use the new class DotNetStreamReference
added in net6 to allow stream directly to disk using JSInterop
(see https://learn.microsoft.com/en-us/aspnet/core/blazor/file-downloads?view=aspnetcore-6.0).
Now, the problem is: gRPC method stream data returning a IAsyncEnumerable<T>
, but the DotNetStreamReference
class accept only a Stream
object as input.
There is a way to convert IAsyncEnumerable<byte[]>
to a Stream
or eventually return a Stream
from a gRPC call?
Thanks