Take the type of the expression’s (first) parameter, and say
Expression<Func<C, string>> c = x => x.B;
Type paramType = c.Parameters[0].Type; // first parameter of expression
var d = paramType.GetMember((c.Body as MemberExpression).Member.Name)[0];
More Related Contents:
- Is there a reason for C#’s reuse of the variable in a foreach?
- Getting all types that implement an interface
- C# Lambda expressions: Why should I use them?
- convert a list of objects from one type to another using lambda expression
- Sorting a list using Lambda/Linq to objects
- Cannot use ref or out parameter in lambda expressions
- C# Lambda ( => ) [duplicate]
- Visual Studio debugging “quick watch” tool and lambda expressions
- How do I pronounce “=>” as used in lambda expressions in .Net [closed]
- What is the Efficiency and Performance of LINQ and Lambda Expression in .Net?
- I want to understand the lambda expression in @Html.DisplayFor(modelItem => item.FirstName)
- Is it Linq or Lambda?
- C# Pass Lambda Expression as Method Parameter
- Expression of type ‘System.Int32’ cannot be used for return type ‘System.Object’
- Peculiar overload resolution with while (true)
- Local variable and expression trees
- FindAll vs Where extension-method
- How to unsubscribe from an event which uses a lambda expression?
- How to cast Expression to Expression
- Why do some C# lambda expressions compile to static methods?
- convert this LINQ expression into Lambda
- Access the value of a member expression
- List complex sorting
- How can I capture the value of an outer variable inside a lambda expression?
- Task.Run with Parameter(s)?
- Expression for Type members results in different Expressions (MemberExpression, UnaryExpression)
- Dynamically Build Linq Lambda Expression
- How do I translate an expression tree of one type to a different expression type?
- Getting the object out of a MemberExpression?
- Convert DataTable to Generic List in C#