Using Reflection to determine which Fields are backing fields of a Property

后端 未结 3 1156
星月不相逢
星月不相逢 2020-12-17 17:58

I\'m using reflection to map out objects. These objects are in managed code but I have no visibility into their source code, underlying structure, etc. other than through re

3条回答
  •  时光说笑
    2020-12-17 18:34

    To answer your other question:Under what circumstances do properties not have backing fields?

    public DateTime CurrentDay
    {
        get { return DateTime.Now; }
    }
    

    or property may use any other number of backing fields/classes

    public string FullName 
    {
        get {return firstName + " " + lastName;}
    }
    

提交回复
热议问题