gRPC C#
gRPC C#
Namespaces
Grpc.Core.Utils
AsyncStreamExtensions Class
AsyncStreamExtensions Methods
ForEachAsync(T) Method
ToListAsync(T) Method
WriteAllAsync Method

AsyncStreamExtensions ToListAsync T Method

Reads the entire stream and creates a list containing all the elements read.

Namespace: Grpc.Core.Utils
Assembly: Grpc.Core (in Grpc.Core.dll) Version: 0.7.0.0
Syntax
C#
VB
C++
F#
Copy

    public static Task<List<T>> ToListAsync<T>(
    	this IAsyncStreamReader<T> streamReader
    )
    where T : class

    <ExtensionAttribute>
    Public Shared Function ToListAsync(Of T As Class) (
    	streamReader As IAsyncStreamReader(Of T)
    ) As Task(Of List(Of T))

    public:
    [ExtensionAttribute]
    generic<typename T>
    where T : ref class
    static Task<List<T>^>^ ToListAsync(
    	IAsyncStreamReader<T>^ streamReader
    )

    [<ExtensionAttribute>]
    static member ToListAsync :
            streamReader : IAsyncStreamReader<'T> -> Task<List<'T>>  when 'T : not struct

#### Parameters

streamReader
  Type: Grpc.Core
  IAsyncStreamReader
  T

  [Missing <param name="streamReader"/> documentation for "M:Grpc.Core.Utils.AsyncStreamExtensions.ToListAsync``1(Grpc.Core.IAsyncStreamReader{``0})"]

#### Type Parameters

T

  [Missing <typeparam name="T"/> documentation for "M:Grpc.Core.Utils.AsyncStreamExtensions.ToListAsync``1(Grpc.Core.IAsyncStreamReader{``0})"]

#### Return Value

Type: Task
List
T

#### Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IAsyncStreamReader
T
. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

#### Reference

AsyncStreamExtensions Class
Grpc.Core.Utils Namespace