I’m trying out expression trees in C# and just got stuck with something that seems simple, but which is also un-googleable. How can I create an expression that references this? Expression.PropertyOrField(..., "this") throws an exception “‘this’ is not a member of type […]”.
The Expression class has a boat-load of methods, but none that seems applicable in this case, and it’s not a search-friendly problem…
“
this“, in your sample code, is equal to.... You already have the object reference. There is no hidden member calledthisor something.thisconceptually only makes sense in the body of an instance method.