I am developing a three-tier architecture for MVC4 webapp + EntityFramwork5. I want to keep the separete layer, so only DAL knows that I use EF, for example.
In fact, I have many classes to manage this:
DAL
- Entity POCO
- Entity DataContext: DbContext
- Object Repository
BL
- Entity ViewModel
- Entity Service (Entity Repository Instance)
WEB
- Entity Controllers (Instance Entity Service)
This works, but is pretty hard to accomplish. I decided to delete the Entity repository in the DAL and use the DataContext directly (if I'm not mistaken, because the DbContext was created as a repository and work unit), but this will force me to add a link to EntityFramework.dll in my BL. Not a big problem, but I'm not sure if this is the best choice.
?
(, , , )