Dave

Dave

  • NA
  • 1
  • 0

Interface that implements list

Nov 25 2009 3:34 AM
I have a requirement to keep all interfaces and classes that inherit from that interface in separate libraries/namespaces.

One of my interfaces needs to have a List of type of a second interface:
e.g.

public interface IYearData
{
int Year{...}
int Total{...}
}


public interface IYears
{
List<IYearData> YearsList {...}
}


Now I want classes that implement these interfaces:

public YearData:IYearData
{
public int Year{...}
public int Total{...}
}


public Years:IYears
{
public List<YearData> YearsList{...}
}


But I can't compile this because the class Years doesn't implement the interface, since YearsList should be of type IYearData and not YearData.

Is there any way round this?

We need to ship the interface library to a third party, but NOT our actual classes.

ANY help very gratefully received.
Thx, Dave.

Answers (1)