I have a few questions regarding decoupling my domain layer and data layer in an MVC3 web application using entity framework as the data access layer.
As it stands right now my controllers are completely dependant on the EF classes and after spending most of the day reading up on dependency injection I am trying to decouple them.
The first question I have is - do I need to effectively duplicate all of the EF classes into my business layer? I obviously cant use the EF classes any more so it seems to me that I need to create a duplicate of every table class in use to get this working. Is this right? So for example if I have 50 EF classes representing 50 tables in my DB, do I need to create 50 new classes in my business layer? -> and then maintain them indefinitely? This sounds like a lot of work.
Secondly, am i correct in assuming that the dependancy gets flipped around and instead of the business layer being dependant on the data layer, the data layer ends up becoming dependant on the business layer?