Can someone explain why this doesn't compile? More specifically, you get an error stating that class A doesn't implement IA, even though B "is a" (implements) IB, which should satisfy IA? Or am I doing something completely wrong?
(I want to keep A/B as specific as possible, while still implementing IA/IB in order to pass it to a method that takes in IA)
public interface IA {
public string Field { get; set; }
public IB B { get; set; }
}
public interface IB {
public string OtherField { get; set; }
}
public class A : IA {
public string Field { get; set; }
public B B { get; set; }
}
public class B : IB {
public string OtherField { get; set; }
}