Hello!
The method you're trying to call from script code is declared like this:
Because you're dealing with a string list, it requires an argument of type
The syntax
To do that, first you need to expose the delegate type to the script engine:
Now you can call the method from script code like this:
Good luck!
The method you're trying to call from script code is declared like this:
publicbool Exists(Predicate<T> match)
Predicate<string>
, which is a delegate type.The syntax
p => p == child.ChildNodes[1].InnerText
is C#-specific and not legal in JavaScript. Instead, you need to create the appropriate delegate around a script function.To do that, first you need to expose the delegate type to the script engine:
engine.AddHostType("StrPred", typeof(Predicate<string>));
pred = function (p) { return p == child.ChildNodes[1].InnerText; }; exists = accountList.Exists(new StrPred(pred));