AL wants Assembly Reference to DAL, why? Better Architecture needed
When I try my pocos from the application layer, it screams for a missing reference to DAL (where the entity framework belongs).
Not so surpr开发者_开发技巧ising because my guides so far reference it as base class. BUT! It's like this..
"Hi application X! Yeah nice, I understand. I will give you the paket, but you have to take the data from DAL yourself, ok?".
There have to be abetter way to code? Isn't it a big point of n-tier that AL and DAL are completely isolated to communicate through BL..?
You have introduced this by using a type from your DAL as a base-class in the BL; in some ways, maybe the problem is, then, that the BL is using (and exposing) too much about the DAL, when maybe that might be better addressed via IoC.
Either way, either live with it, or expect a big refactor; .NET can't use your type if it uses a base-class or interface it can't resolve; so it will need the assembly reference.
it screams for a missing reference to DAL (where the entity framework belongs).
Ah - no, The EntityFramework IS NOT A DAL. It is a business object runtime. it CONTAINS a DAL, but it basically spawns moer than one tier.
It is totally ok to expose it further up as it is a runtime for business obejcts.
If you use the EntityFramework purely as a DAL this is a questionable usage.
精彩评论