PropertyExpression is missing

.net c# expression expression-trees lambda

Question

I try to write a simple example using Expressions, but have a strange bug: I can't use PropertyExpression at compile time. When I write it I get an error and it doesn't compile enter image description here But in runtime at breakpoint I can write

var runtimeBody = (System.Linq.Expressions.PropertyExpression)body2;

and it works, and casts as expected. Framework 4.5.1 is selected as target.

1
43
4/30/2015 8:11:13 AM

Accepted Answer

PropertyExpression is internal

This post suggests you try to cast it to System.Linq.Expressions.MemberExpression instead.

60
12/18/2017 10:26:32 AM


Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow