コード例 #1
0
        static void Main()
        {
            var derivedOne = new DerivedOne();
            var derivedTwo = new DerivedTwo();

            var one = derivedOne.Create();
            var two = derivedTwo.Create();
        }
コード例 #2
0
    static void Main(string[] args)
    {
        List <BaseEntity> list = new List <BaseEntity>();
        DerivedOne        d1   = new DerivedOne()
        {
            bp1 = 1, Name = "DerivedOne"
        };
        DerivedTwo d2 = new DerivedTwo()
        {
            bp1 = 2, Name = "DerivedTwo"
        };

        list.Add(d1);
        list.Add(d2);
    }