Share via


ModuleClient.SetMethodHandlerAsync Method

Definition

Overloads

SetMethodHandlerAsync(String, MethodCallback, Object)

Sets a new delegate for the named method. If a delegate is already associated with the named method, it will be replaced with the new delegate. A method handler can be unset by passing a null MethodCallback.

SetMethodHandlerAsync(String, MethodCallback, Object, CancellationToken)

Sets a new delegate for the named method. If a delegate is already associated with the named method, it will be replaced with the new delegate. A method handler can be unset by passing a null MethodCallback.

SetMethodHandlerAsync(String, MethodCallback, Object)

Sets a new delegate for the named method. If a delegate is already associated with the named method, it will be replaced with the new delegate. A method handler can be unset by passing a null MethodCallback.

public System.Threading.Tasks.Task SetMethodHandlerAsync(string methodName, Microsoft.Azure.Devices.Client.MethodCallback methodHandler, object userContext);

Parameters

methodName
String
methodHandler
MethodCallback
userContext
Object

Returns

Applies to

Azure SDK for .NET Latest and Azure SDK for .NET Legacy
Product Versions
Azure SDK for .NET Legacy, Latest

SetMethodHandlerAsync(String, MethodCallback, Object, CancellationToken)

Sets a new delegate for the named method. If a delegate is already associated with the named method, it will be replaced with the new delegate. A method handler can be unset by passing a null MethodCallback.

public System.Threading.Tasks.Task SetMethodHandlerAsync(string methodName, Microsoft.Azure.Devices.Client.MethodCallback methodHandler, object userContext, System.Threading.CancellationToken cancellationToken);

Parameters

methodName
String
methodHandler
MethodCallback
userContext
Object
cancellationToken
CancellationToken

Returns

Applies to

Azure SDK for .NET Latest and Azure SDK for .NET Legacy
Product Versions
Azure SDK for .NET Legacy, Latest