ClientBase<TChannel>.InvokeAsync Method

Definition

Provides support for implementing the event-based asynchronous pattern. For more information about this pattern, see Event-based Asynchronous Pattern Overview.

C#
protected void InvokeAsync(System.ServiceModel.ClientBase<TChannel>.BeginOperationDelegate beginOperationDelegate, object[] inValues, System.ServiceModel.ClientBase<TChannel>.EndOperationDelegate endOperationDelegate, System.Threading.SendOrPostCallback operationCompletedCallback, object userState);

Parameters

beginOperationDelegate
ClientBase<TChannel>.BeginOperationDelegate

A delegate that is used for calling the asynchronous operation.

inValues
Object[]

The input values to the asynchronous call.

endOperationDelegate
ClientBase<TChannel>.EndOperationDelegate

A delegate that is used to end the asynchronous call after it has completed.

operationCompletedCallback
SendOrPostCallback

A client-supplied callback that is invoked when the asynchronous method is complete. The callback is passed to the ClientBase<TChannel>.BeginOperationDelegate.

userState
Object

The userState object to associate with the asynchronous call.

Remarks

Provide a unique value, such as a GUID or hash code, in the userState parameter for each call to InvokeAsync(ClientBase<TChannel>.BeginOperationDelegate, Object[], ClientBase<TChannel>.EndOperationDelegate, SendOrPostCallback, Object), and when each operation is completed, your event handler can determine which instance of the operation raised the completion event.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
UWP 10.0