I have JS code:
function on_save() {
Service.AddTableRow([{id: 21194, value: "jjkk"}, {id: 1234, value: "Lala"}]);
return true;
}
Into c# I do:
var engine = new V8ScriptEngine();
engine.AddHostObject("Service", scriptService);
engine.Execute(content);
result = engine.Script.on_save();
Into scriptService I have:
public void AddTableRow(Dictionary<string, object> values)
{
//but there is invalid argument "values"
//I also tried List<object> param type but result is the same
}
How can I resolve this issue?
Try something like this:
You can see this sample working here.
EDIT: If you're using something older than ClearScript 6, you can do something like this instead:
This technique is also demonstrated here. Newer ClearScript versions support both.