Otter SDK Reference
Version:

InvokeMethodAsync(System.Reflection.MethodBase method, object instance, object[] parameters) Method

Invokes the method on the remote server using the specified arguments, and returns the result.

Syntax

public abstract Task<object> InvokeMethodAsync(System.Reflection.MethodBase method, object instance, object[] parameters)

Parameters

method
Type: System.Reflection.MethodBase

The method to invoke.

instance
Type: object

The instance to serialize and invoke the method on.

parameters
Type: object[]

The parameters to pass to the method. May be null (Nothing in Visual Basic) if there are no parameters.

Returns

Return value of the method if applicable; otherwise null (Nothing in Visual Basic).

Exceptions

System.ArgumentNullException

method is null (Nothing in Visual Basic).

System.ArgumentException

method is not valid or parameters are not valid. See Remarks.

Remarks

The method supplied in method must refer to a single static method or a single instance method of a serializable class. The values in parameters must correspond to the arguments types of the specified method. If the remote method throws an unhandled exception, the exception will be rethrown at the client.