Is there a collection in c# that supports the inheritance like concept that objects can have of appearing to include all the elements from another as well as themselves?
For example:
HashSet<animal> animals = new HashSet<animal>();
HashSet<dog> dogs = new HashSet<dog>();
animals.also_appears_to_include(dogs);
So if I for example added 2 elements to dogs and 1 to animals, then looked at how many elements animals has I would see 3.
Alternatively I could put references to the above mentioned 3 elements in each, giving animals 3 elements and dogs 2. I'd still have the two separate, overlapping lists which is desirable, however adding and removing elements could become tricky, in this simple example having to add or remove from both collections in the case of adding and removing dogs.
Or I could implement my own collection with this functionality.