/
Program.cs
31 lines (26 loc) · 888 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace InheritanceTest
{
class Program
{
static void Main()
{
var fooList = new List<FooModel>();
var fooItem = new FooModelItem { Name = "Foo item 1" };
var fooModel = new FooModel { Name = "Foo List" };
fooModel.AddItem(fooItem);
fooList.Add(fooModel);
var barList = new ObservableCollection<BarModel>();
var barItem = new BarModelItem { Name = "Bar item 1" };
var barModel = new BarModel { Name = "Bar List" };
barModel.AddItem(barItem);
barList.Add(barModel);
var service = new Service();
service.DoSomethingWith(fooList);
service.DoSomethingWith(barList);
Console.ReadLine();
}
}
}