NRules Adding Additional Condition

236 views Asked by At

I have a rule such as

When()
  .Match<ObjectA>(a => a.Field1 == "xxx",
                  a => a.Field2 == "yyy",
                  a => a.List1.Where(l => l.Field3 = "111").Count() > 0);

Which returns results

However when I try to add additional conditions to the Where clause e.g.

When()
  .Match<ObjectA>(a => a.Field1 == "xxx",
                  a => a.Field2 == "yyy",
                  a => a.List1.Where(l => l.Field3 == "111" && l.Field4 == "222" ).Count() > 0);

It returns an error saying "Failed to evaluate condition ....."

How do I extend the criteria against the List?

1

There are 1 answers

1
CB1 On

Turns out nothing to do with NRules but issue with the condition being added - should have taken more time before posting.