Linq - Merging Access Attributes

I have a MemberExpression that contains the following: mail => mail.SomeProperty .

I want to generate a new member expression to access one level in the hierarchy and get the following result: mail => mail.SomeProperty.OtherProperty .

How to do it?

+4
source share
1 answer

I believe that you can use Expression.Property to create a new MemberExpression that wraps the existing expression with an additional property reference. It takes an expression for the first argument, which should be the original MemberExpression.

+4
source

Source: https://habr.com/ru/post/1345957/


All Articles