I have a class which has two objects with in it. For example:
public class Animal
{
public Carnivorous MeatEater { get; set; }
public Herbivorous VegEater { get; set; }
public Animal()
{
this.MeatEater = new Carnivorous();
this.VegEater = new Herbivorous();
}
}
Carnivorous and Herbivorous have a Category property.
I populated this class with a list of data from my database which is stored in either MeatEater or VegEater.
I need to get a distinct list of Category from both and MeatEater and VegEater combined.
How can I get this list?
Thanks!
Categoryclass?