I have an interface:
interface IFoo<out T>
{
T Get();
}
and some instances like IFoo<int> a
, IFoo<User> u
, IFoo<string> s
and etc. There is a List<IFoo<object>>
used to collect them. But variance doesn't work for value types, is there a proper way to put them in the list?