Best way to get sub properties using GetProperty

后端 未结 6 685
南方客
南方客 2020-12-08 10:21
public class Address
{
    public string ZipCode {get; set;}
}

public class Customer
{
    public Address Address {get; set;}
}

how can I access e

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-08 11:11

    typeof (Customer).GetProperty("Address").PropertyType.GetProperty("ZipCode")
    

提交回复
热议问题