Aspnetcore.docs: var stream = await ... ?

Created on 13 Nov 2020  Â·  6Comments  Â·  Source: dotnet/AspNetCore.Docs

About: “.NET client, Server-to-client streaming”. In the first snip, the clause await shows a syntax error: “'IAsyncEnumerable' does not contain a definition for 'GetAwaiter'”, whereas, without “await”, it works fine.

Is this an error in the article, or am I doing something wrong?

I appreciate your answer.


Document Details

âš  Do not edit this section. It is required for docs.microsoft.com âžź GitHub issue linking.

SignalR Source - Docs.ms doc-bug

All 6 comments

Hi Rick - Thanks for your attention

The reference you mention to me I had already seen. It does not match with my question, which refers to a non-web client.

I published a test project for more information, you can check in https://github.com/harveytriana/StreamingTest, look in the Program class of ConsoleClient the comment: // QUESTION.

I still believe that it is an error in the documentation, correct me if anything.

NOTE. The same happens with .NET Core 3.1

https://docs.microsoft.com/aspnet/core/signalr/streaming?view=aspnetcore-3.1&source=docs#server-to-client-streaming-1

The line:

var stream = await hubConnection.StreamAsync<int>(
    "Counter", 10, 500, cancellationTokenSource.Token);

should not have an await.

@BrennanConroy thanks, I'll get this fixed.

Thanks

Was this page helpful?
0 / 5 - 0 ratings