I have this method:
void SomeMethod<T,V>() where T:V
{
List<T> listT = getT();
List<V> listV = listT.ToList<V>()
}
Its says that listT dont contains a ToList() method.
The above implementation doesn't work. But it works with concrete classes, like below:
interface Ifoo{}
class Bar : Ifoo{}
List<Bar> bar = getBar();
List<Ifoo> bar2 = bar.ToList<Ifoo>()
Why is that? How can I make the method works with those generics constraint?