I have a table like the following:
RuleStep
StepID | Step Property | Step Condition Id | Step Value | Logical Operator | Next Step Id
One of the rows could be the following:
100, Name, 200 (which means equals) , AnyName, 210 (which means And), 300 (points to the next step id).
The above means that I should be evaluating a rule which has a step saying that Name should be equal to AnyName and the next step is chained by operator AND. The next step could be say – age should be equal to 10.
These rules should be evaluated against an object Person with 2 properties Age & Name.I have to verify whether the persons name is AnyName and Age is 10.
Can you please let me know how do I do this? Is there any libraries which can support this? Is there any specific functionality inside C# which can help me?
Thanks,
– Mike
You can try the PredicateBuilder from the LinqKit package, available via NuGet.