Converting List<T> using covariance
I saw an interesting use of covariance today, consider an interface IMyClass and an implementing class MyClass: 1: public interface IMyClass { } 2: 3: public class MyClass : IMyClass { } If you want to convert an List<MyClass> to a List<IMyClass> you would normally use the Enumerable.Cast method but did you know that you …