So, I am working on a project where I need to parse an expression tree. I got most of the work, but I got a problem.
I looked at other questions in StackOverflow on expression trees, but cannot find the answer to my question, so here it goes.
My problem is the difference (or lack) between constants and variables. Let me start with an example:
user => user.Email == email
This is clearly not a constant, but a variable, but ultimately this is a ConstantExpression expression somewhere in the expression tree. If you look at the expression itself, it looks a little strange:
Expression = {value(stORM.Web.Security.User+<>c__DisplayClassa)}
If you take another example:
task => task.Status != TaskStatus.Done && t.Status != TaskStatus.Failed
Here I am using ENUM (TaskStatus).
, , , , ConstantExpression , . , , , , .
EDIT: , , . :
user = db.Search < > (u = > u.Email == email);
. , , , .
:
IList < a > tasks = db.Search(t = > t.Status!= TaskStatus.Done & t.Status!= TaskStatus.Failed);
, Done Failed.
. , , . - , SQL , Done Failed.