I know this is an old thread, but in case anyone else comes across it, I have a slightly better solution for using EF.
Basically, I have two interfaces
public interface IProduct { int Id { get; set; } String Description { get; set; } String Number { get; set; } String Name { get; set; } }
and
public interface IEFProduct { ICollection<IProcess> Processes { get; set; } ICollection<ILine> Lines { get; set; } }
I keep the IProduct interface in my contract project, so it is still completely independent of the rest of my model, but I put the IEFProduct interface in my Model project, as this contains a specific implementation. This means that I cannot access the processes and lines from everything that implements the interface, not a specific type, but in my case it caused a problem.
Another way forward will be to use DTO.
All your models will use the interface, but your actual EF implementation will use Concrete DTO, in a data layer that you would display between them either manually or using Automapper - of course, this can have a small performance impact.
source share