Share via


ILanguageClientMiddleLayer2<T>.HandleRequestAsync Method

Definition

Intercepts JSON-RPC request calls for methodName.

public System.Threading.Tasks.Task<T?> HandleRequestAsync (string methodName, T methodParam, Func<T,System.Threading.Tasks.Task<T?>> sendRequest);
abstract member HandleRequestAsync : string * 'T * Func<'T, System.Threading.Tasks.Task<'T>> -> System.Threading.Tasks.Task<'T>
Public Function HandleRequestAsync (methodName As String, methodParam As T, sendRequest As Func(Of T, Task(Of T))) As Task(Of T)

Parameters

methodName
String

The name of the method that is being intercepted.

methodParam
T

Parameter to be sent for the request.

sendRequest
Func<T,Task<T>>

Function delegate which will send the request to the server. This delegate can be ignored and not invoked if the choice is to not send the request to the server. It must be invoked in this method if the choice is to send the request to the server.

Returns

Task<T>

A Task<TResult> corresponding to a valid response for the given method.

Applies to