First off, sorry if my title doesn't relate to my question. it has been a long day.
Basically, i wanted to know if i can write a class that takes lambda expression and evaluate its condition. IE:
(x=>x.property1 == 1) or x=>x.property1 < 1)
Ultimately, once the expression is passed to my class, I want to be able to evaluate the expression.
I'm trying to add some custom validator into FluentValidation. And my first issue was to be able to parse the lambda expression:
RuleFor(x=>x.Property2).RequiredIF(x=>x.Property1==0)