ScriptParser.ExecuteScriptAsync
Executes a script that supports {{ expression }} and {{% code block }} syntax
and returns a string result. This version allows for async
code inside of
the template.
You can optionally pass in a pre-configured CSharpScriptExecution
instance
which allows setting references/namespaces and can capture error information.
Function returns null
on error and scriptEngine.Error
is set to true
along with the error message and the generated code.
public Task<string> ExecuteScriptAsync<TModelType>(string script, TModelType model, CSharpScriptExecution scriptEngine, string basePath)