For the sake of the question, I have a project structured as follows, where each layer maps to a project in my visual studio solution:
- Presentation Layer
- Business Logic Layer
- Data Layer (working with Entity Framework)
I have repository classes defined in my Data Layer. Upon instancing them in the BL layer, I get an error stating that a reference to the entity framework assembly is missing. I add a reference to the same entity framework dll that is being used in my DL and it works.
My question is: why is it not sufficient to have the BL reference the DL, why do I still need to add an "additional" reference to EF in the BL ? I obviously do not want to control more than one EF version in my solution.
I would think my DL is an "atomic" unit, all its objects are self contained and need nothing else to function properly. Why then upon instancing classes defined in the DL would I still need to add a EF reference, what with the DL's own EF reference ?