CSharpScriptExecution.ExecuteMethodAsync
Executes a complete async method by wrapping it into a class, compiling and instantiating the class and calling the method. This method has to return a result value - it cannot be void!
Class should include full class header (instance type, return value and parameters)
"public async Task
Async Method Note: Keep in mind that
the method is not cast to that result - it's cast to object so you
have to unwrap it:
var objTask = script.ExecuteMethod(asyncCodeMethod); // object result
var result = await (objTask as Task
public Task<TResult> ExecuteMethodAsync<TResult>(string code, string methodName, object[] parameters)
Parameters
code
One or more complete methods.
methodName
Name of the method to call.
parameters
any number of variable parameters