私はそれに2つのオブジェクトを持つクラスを持っています。例えば:
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から、 の個別のリストを取得する必要があります。このリストを取得するにはどうすればよいですか?MeatEaterVegEater
ありがとう!