ActiveScriptEngine.Extensions by Shane Taylor

<PackageReference Include="ActiveScriptEngine.Extensions" Version="1.0.0" />

 ActiveScriptEngineExtensions

public static class ActiveScriptEngineExtensions
Provides useful extension methods when using the ActiveScriptEngine.
public static T Evaluate<T>(this ActiveScriptEngine engine, string code)

Provides a generic overload for engine.Evaluate. This method will invoke Convert.ChangeType on the returned value to try convert it to type T. This provides a more easier way to get the value of a type you want.

public static object NewInstanceOf(this ActiveScriptEngine engine, string className)

Creates a new instance of the specified class from within the script engine and returns it.