please assume to have to classes, implementing their interfaces:
public interface ICube
{
ICollection<IColor> sideColors {get; set; }
}
public interface IColor
{
float getHue ();
}
public class Cube : ICube
{
public ICollection<IColor> sideColors {get; set; }
}
public class Color : IColor
{
public Color (float r, float g, float b)
{
...
}
public float getHue ()
{
...
}
}
Now i want to expose the interface to another assembly, this assembly must not know anything about the implementation of the model. Beside that, i want to use the model for definition of database design with CodeFirst. In this case, EF can not use the definition of the ICollection, but needs a definition like ICollection. What is the best practice to satisfy both requirements: - Masking of implementation of class Cube - Use the model for EF
Best regards, Teimo