-
I am trying to use ClearScript instead of Jint in OrchardCore, but I found that the delegate method parameter cannot be passed As the screenshot shows, the delegate parameters are not fixed Is there a way to make this call? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
hyzx86
Jan 24, 2023
Replies: 1 comment
-
Done, it works 😊 var engine = new V8ScriptEngine();
var methods = scriptingManager.GlobalMethodProviders.SelectMany(x => x.GetMethods());
if (extraMethods != null)
{
methods = methods.Concat(extraMethods);
}
foreach (var method in methods)
{
engine.Script[method.Name]=method.Method(serviceProvider);
}
return engine; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hyzx86
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Done, it works 😊