How to access to the parent object in c#

后端 未结 7 839
难免孤独
难免孤独 2020-12-14 06:28

I have a \"meter\" class. One property of \"meter\" is another class called \"production\". I need to access to a property of meter class (power rating) from production clas

7条回答
  •  庸人自扰
    2020-12-14 06:49

    something like this:

      public int PowerRating
        {
           get { return base.PowerRating; } // if power inherits from meter...
        }
    

提交回复
热议问题