Suppose this fairly simple expression:
Expression<Func<DayOfWeek, bool>> filter = d => d == DayOfWeek.Friday;
In LinqPad I get an UnaryExpression
for the right part, which is what I want, so I can work with the enum value and type:
However, in a VS, I get a totally different ConstantExpression
which converts the value to an integer:
I really have no clue why this is happening. Is there a global setting I'm missing in VS or something?
It happens in VS 2015 AND 2010 as well.
Aucun commentaire:
Enregistrer un commentaire