so, I have this:
- Web App
- Business Logic
- Data Access Logic
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?
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.