私はそれに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
から、 の個別のリストを取得する必要があります。このリストを取得するにはどうすればよいですか?MeatEater
VegEater
ありがとう!