Hello!
ClearScript doesn't convert script functions to delegates automatically, but it provides an easy way to create a delegate that invokes a script function. Try something like this:
Please let us know if this doesn't work for you.
Thanks!
ClearScript doesn't convert script functions to delegates automatically, but it provides an easy way to create a delegate that invokes a script function. Try something like this:
engine.AddHostType("Enumerable", typeof(Enumerable)); engine.AddHostType("ProjectPredicate", typeof(Func<Project, bool>)); engine.Execute(@" predicate = new ProjectPredicate(function (w) { return w.Id == 100; }); result = uow.Projects.Where(predicate).ToList(); ");
Thanks!