// The Structure of the Container and the items public interface IContainer <TItem> where TItem : IItem { } public class AContainer : IContainer<ItemA> { } public interface IItem { } public class ItemA : IItem { } // Client app [Test] public void Test () { IContainer<IItem> container = new AContainer(); }
Question: The following error occurs in the test. What could be a casting solution?
It is not possible to implicitly convert the type "AContainer" to "IContainer". Explicit conversion exists (are you skipping listing?)
source share