Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PropertyExpression is missing

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.

like image 866
Alex Zhukovskiy Avatar asked Apr 30 '15 08:04

Alex Zhukovskiy


1 Answers

PropertyExpression is internal

You should cast it to System.Linq.Expressions.MemberExpression instead, as suggested in this post.

like image 56
Sébastien Sevrin Avatar answered Sep 29 '22 10:09

Sébastien Sevrin