How can I put subclasses from the same baseclass into a list?

后端 未结 2 1276
抹茶落季
抹茶落季 2021-01-19 06:38

How can I put subclasses from the same baseclass into a list?

I´m working with ASP.NET MVC3 and have created a basemodel-class with properties like name, age and so

2条回答
  •  野的像风
    2021-01-19 07:23

    I'd recommend

    List
    

    for

    class Derived1 : BaesClass {}
    class Derived2 : BaesClass {}
    

提交回复
热议问题