开发者

Linq - Merging property accessor expressions

开发者 https://www.devze.com 2023-02-21 02:08 出处:网络
I have a MemberExpression that con开发者_运维百科tains the following: mail => mail.SomeProperty.

I have a MemberExpression that con开发者_运维百科tains the following: mail => mail.SomeProperty.

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

How to do this?


I believe you can use Expression.Property to construct 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消