I had use NRules.Language some little time . It is powerful !
But now I have a problem when using nested objects .Think you have a "Order" object , it has a list to store the detail item. Now I have a rule that when any item has some product , the order will had a discount .
The rule look like
Name "order rule smaple"
when
var order= Order(x=>x.Items.Any(i=>i.Product.Name=="some product"));
then
order.discount=1;
Unfortunately,it is not work.The erro message say " x.Items has not a member "Any" " . When I debuging,the Items only has its' index member. So the rule only support look like "x.Items[index].Product.Name=="some product"" .
I had use NRules.Language some little time . It is powerful !
But now I have a problem when using nested objects .Think you have a "Order" object , it has a list to store the detail item. Now I have a rule that when any item has some product , the order will had a discount .
The rule look like
Unfortunately,it is not work.The erro message say " x.Items has not a member "Any" " . When I debuging,the Items only has its' index member. So the rule only support look like "x.Items[index].Product.Name=="some product"" .