// 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 : In test the following error occures. What can be the solution for casting?
Cannot implicitly convert type 'AContainer' to 'IContainer'. An explicit conversion exists (are you missing a cast?)