Access nested properties with dynamic lambda using Linq.Expression

前端 未结 4 2508
说谎
说谎 2021-02-20 10:39

Let\'s assume that I have two classes:

class person
{
    int ID
    string name
    Address address
}
class address
{
    int ID
    string street
    string co         


        
4条回答
  •  迷失自我
    2021-02-20 11:30

    What is not clear?

    You have to split it and then use:

    Expression.Property(Expression.Property(param, "address"), "street")
    

提交回复
热议问题