我有一个类,其中有两个对象。例如:
public class Animal
{
public Carnivorous MeatEater { get; set; }
public Herbivorous VegEater { get; set; }
public Animal()
{
this.MeatEater = new Carnivorous();
this.VegEater = new Herbivorous();
}
}
Carnivorous并Herbivorous拥有Category财产。
MeatEater我用我的数据库中存储在或中的数据列表填充了这个类VegEater。我需要Category从两者中获得一个不同的列表MeatEater和VegEater组合。我怎样才能得到这个清单?
谢谢!