HubConnection.InvokeCoreAsync Metoda

Definicja

Wywołuje metodę centrum na serwerze przy użyciu określonej nazwy metody, zwraca typ i argumenty.

public System.Threading.Tasks.Task<object> InvokeCoreAsync (string methodName, Type returnType, object[] args, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task<object?> InvokeCoreAsync (string methodName, Type returnType, object?[] args, System.Threading.CancellationToken cancellationToken = default);
member this.InvokeCoreAsync : string * Type * obj[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
abstract member InvokeCoreAsync : string * Type * obj[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
override this.InvokeCoreAsync : string * Type * obj[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
Public Function InvokeCoreAsync (methodName As String, returnType As Type, args As Object(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Public Overridable Function InvokeCoreAsync (methodName As String, returnType As Type, args As Object(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)

Parametry

methodName
String

Nazwa metody serwera do wywołania.

returnType
Type

Zwracany typ metody serwera.

args
Object[]

Argumenty używane do wywoływania metody serwera.

cancellationToken
CancellationToken

Token do monitorowania żądań anulowania. Wartość domyślna to None.

Zwraca

Element Task<TResult> reprezentujący wywołanie asynchroniczne. Właściwość Result zwraca wartość zwracaną Object przez metodę hub.

Uwagi

Jest to metoda niskiego poziomu do wywoływania metody centrum na serwerze. HubConnectionExtensions InvokeAsync Zalecane jest użycie metody rozszerzenia.

Dotyczy