Maybe I'm dumb but ...
I have:
public interface IRequest
{
IList<IRequestDetail> Details { get; set; }
// stuff
}
public interface IRequestDetail
{
// stuff
}
I then have:
public class MyRequest : IRequest
{
IList<MyRequestDetail> Details {get; set; }
// stuff
}
public class MyRequestDetail : IRequestDetail
{
// stuff
}
It doesn't work.
C# gets pissed at me because MyRequest does not implement the interface due to not having an IList of IRequestDetail.
Now if I change it so the Details is IList of IRequestDetail I then have to cast it to MyRequestDetail everywhere in the code I use a non-interface member (I have several requests that share common stuff, but then specialize).
I kind of understand why its wrong, but not fully!