Logic and its application to Collections.Generic and inheritance

后端 未结 6 1825
猫巷女王i
猫巷女王i 2021-01-06 20:49

Everything inherits from object. It\'s the basis of inheritance. Everything can be implicitly cast up the inheritance tree, ie.

object me = new Person();
         


        
6条回答
  •  抹茶落季
    2021-01-06 21:42

    you can use linq to cast it:

    IEnumerable oldList = someIenumarable;
    IEnumerable newList = oldlist.Cast()
    
        

    提交回复
    热议问题