开发者

Linq - Merging property accessor expressions

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜