I have two interfaces:
public interface A {
void aMethod();
}
public interface B : A {
void bMethod();
}
Later I'm basically using a dictionary like this:
Dictionary<int, A> dict = new Dictionary<int, B>();
C# is saying I can't convert from the right to the left, even if I cast it. Is there a way to use generics in C# so that this can work? If I make them abstract classes it seems to be ok but I need these as interfaces.
Dictionary<int, B>
to aDictionary<int, A>
. – Faker