I developing a 3 tier architecture for an MVC4 webapp + EntityFramwork5. I want to keep separete the layer, so only DAL knows that I'm using EF, for example.
Actually I have a lot of classes to manage that:
DAL
- Entity POCO
- Entity DataContext : DbContext
- Entity Repository
BL
- Entity ViewModel
- Entity Service(instantiate Entity Repository)
WEB
- Entity Controllers (instantiate Entity Service)
This is working but is quite hard to mantain. I was thinking to remove the Entity Repository in DAL and use directly the DataContext (if I'm not wrong, after all DbContext has been desingned to be a Repository and a Unit of Work), but that will force me to add a reference to EntityFramework.dll in my BL. Is not a big issue, but I0m not sure it is the best choice.
Any advice?
(I hope I gave enough informations, if you need more, just ask)