How to cast a generic type at runtime in c#
I need to create an `IEnumerable<IEnumerable<T>>` when I only know `T` at runtime.

I have built up my collection like so:

    new List<List<object>>() 

where all the objects in the inner list are a `T`


However because of co/contravariance (can never remember which it is!) my `List` of `List`s isnt an `IEnumerable` of `IEnumerable`s.

What can I do about this?

I've tried using `Convert.ChangeType` but it moans that `List` isn't `IConvertible`

Thanks


How to cast a generic type at runtime in c#
===

I need to create an `IEnumerable<IEnumerable<T>>` when I only know `T` at runtime.

I have built up my collection like so:

    new List<List<object>>() 

where all the objects in the inner list are a `T`


However because of co/contravariance (can never remember which it is!) my `List` of `List`s isnt an `IEnumerable` of `IEnumerable`s.

What can I do about this?

I've tried using `Convert.ChangeType` but it moans that `List` isn't `IConvertible`

Thanks

