C# cast Foo<Bar> to Foo<object>
- by Michael
Hi, does anyone know if it is possible to cast a generic type with a certain type parameter (e.g. Bar) to the same generic type with the type parameter being a base type of Bar (such as object in my case). And, if it is possible, how would it be done?
What I want to do is have a collection of Foo but be able to add Foos with more specific type arguments.
Thanks