It's probably best I explain with an example.
I am writing a fluent interface, which includes a Where method:
public FluentSearch Where(Expression<Func<IJourney, bool>> expression)
which I might call like this:
.Where(j => j.Driver.Chatiness == searchResource.Chatiness)
Using a watch in the debugger, I can see that there is a property with the value I'm after:
expression.Expression.Member.Name
However, when I create a watch from this property, I get the following:
((new System.Linq.Expressions.Expression.MemberExpressionProxy((new System.Linq.Expressions.Expression.MemberExpressionProxy(expression as System.Linq.Expressions.PropertyExpression)).Expression as System.Linq.Expressions.PropertyExpression)).Member).Name
However the compiler complains about the protection level of the MemberExpressionProxy, as well as a complaint about the number of arguments to a constructor.
Does anyone know how I can get around this problem and get either a name in a string, or a type (IDriver in this case)?