Scenario
I have three IEnumerable lists – IEnumerable<Dog>, IEnumerable<Cat> and IEnumerable<Horse>.
I want them in all in a single IEnumerable<NameColor>.
I have a public static explicit operator NameColor defined on each of the Dog, Cat and Horse objects to allow me to cast them to NameColor
So:
IEnumerable<NameColor> list = dogs as IEnumerable<NameColor>;
list = list.Union(cats as IEnumerable<NameColor>);
list = list.Union(horses as IEnumerable<NameColor>);
However, this doesnt work. I get the error Value cannot be null. but I dont see a parameter called
Parameter name: firstfirst even being an option?!
I suggest: