-
_engine.SetValue("condition", condition);
_engine.SetValue("RuleResult", TypeReference.CreateTypeReference(_engine, typeof(RuleResult)));
var script = """
function evaluate(){
return new RuleResult(condition.Id, [], false);
}
""";
_engine.Execute(script);
var res = _engine.Invoke("evaluate");
var ob = res.AsObject(); I got
The type definitions for public record RuleViolation(string Id, string Message);
public record RuleResult(Guid RuleInputId, List<RuleViolation> RuleViolations, bool IsOK); |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
OK if I modify the code to become function evaluate(){
var ListOfRuleViolations = System.Collections.Generic.List(RuleViolation);
var list = new ListOfRuleViolations();
return new RuleResult(condition.Id, list, true);
} this error |
Beta Was this translation helpful? Give feedback.
-
Does it work with 3.x beta? |
Beta Was this translation helpful? Give feedback.
-
I am using
|
Beta Was this translation helpful? Give feedback.
Try
var ob = res.ToObject();