Reputation: 33978
so, I have this:
I created in the data access logic, the entities, the context, the initializer.
SO usually the higher layers, call the lower layer functionality, right?
If I want to save a customer, I want to create a Customer entity from the web app. What I dont like is having a direct reference from the web app layer to the data access logic layer (class library)
any idea?
Upvotes: 0
Views: 949
Reputation: 218702
This is how i did it on a previous project
4 Projects under my Solution
1) UI ( my ASP.NET MVC Application)
2) Business Entities ( My POCOS's for Entities like Customer, Order etc..)
3) Business Logic ( My Inermediate Service Layer which stays in between UI and DataAccess layer. I would do my business specific validations here.
4) The Data Access Layer. Talks to my database. Can be EF / pure ADO.NET Stored Proc etc..
From UI, I call methods of Middle Layer (Business Logic) and from there after doing custom validations / business rules, i would call Data Access Layer methods.
Upvotes: 0
Reputation: 271
I know this probably isn't very constructive but if I was you I would just add the reference. There no point making things harder on your self to find a more complicated way to do something which should be easy. plus if you skip it now and come across a better solution later you can just modify your code.
Upvotes: 1