The following code:
public interface ISomeData
{
IEnumerable Data { get; }
}
public class MyData : ISomeData
{
private List
If you need to have a list in your interface (known number of items with random access), you should then consider changing the interface to
public interface ISomeData
{
ICollection Data { get; }
}
This will give you both the extensibility and the features you need from a list.
List cannot be easily subclassed, meaning that you might have trouble returning that exact type from all the classes that want to implement your interface.
ICollection on the other hand, can be implemented in various ways.