I have a class A and a class B, class B is inherit from class A.
Assume that I have:
A a1 = new B();
A a2 = new B();
List<A> LA = new List<A>{a1, a2};
Please help me how to convert List to List. I try to use List<B> LB = (List<B>)LA but get compiling error "Can't convert List<A> to List<B>".
Please help me. Thanks.
Note: only .NET 2.0. Thanks.
You have to cast each item in the list, not the whole list.