Skip to content

Add support for nested lambda expressions in rule conditions #1

Description

@jonechenug

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"" .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions