Otter SDK Reference
Version:

InvokeFuncAsync<TResult>(IRemoteMethodExecuter agent, System.Func<TResult> method) Method

Invokes the method on the remote server and returns the result.

Syntax

public static Task<TResult> InvokeFuncAsync<TResult>(IRemoteMethodExecuter agent, Func<TResult> method)

Parameters

agent
Type: IRemoteMethodExecuter

The agent to invoke the method on.

method
Type: System.Func<TResult>

The method to invoke.

Returns

Return value of the method.

Exceptions

System.ArgumentNullException

agent or method is null (Nothing in Visual Basic).

System.ArgumentException

method is 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 paremeter values 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.