I have created an empty MVC project, in that I need to access database i am not using any entity framework ,just directly using codes. Here I have attached the snapshot of my project architecture in that u can see Data Access Layer folder, is it a good way to use the Data Access Layer in the same project or do we need to create a separate project for data access layer.
Project Architecture Snapshot:
It is up to the architecture you choose. Basically in your MVC project your model communicate with the data.
If you are using ADO
i would like to suggest move the model into separate class library
also DataAccess
into seperate class library which we are using in 3-tier
models.
Hence you can call data access from business logic
which are separated from the mvc project.
Some thing like this
In the model you can use the BLL
Or you can add the App_Data
folder and write a data access helper class and write the business logic in model itself. I would like to suggest separate it using the first method.
I am also face similar probelm.see following is help for you. http://www.codeproject.com/Articles/70061/Architecture-Guide-ASP-NET-MVC-Framework-N-tier-En
I use repository pattern and unit of work.But there you are redundancy coding via layers.the above link contain bit old one see is that help to you. don't forget to make a commet on this.thank you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With