CSharpScriptExecution.ExecuteCodeAsync

Executes a snippet of code. Pass in a variable number of parameters (accessible via the parameters[0..n] array) and return an object value.

Code should always return a result: include: return (object) SomeValue or return null

public Task<TResult> ExecuteCodeAsync<TResult>(string code, object[] parameters)

Parameters

code
The code to execute

parameters
The parameters to pass the code You can reference parameters as @0, @1, @2 in code to map to the parameter array items (ie. @1 instead of parameters[1])

Overloads