I ran some searches but found no available answer to this issue.
Okay, my MVC 3 architecture is like this:
- Project.EDM (contains only the entity framework edmx file and its .tt and .cs entity classes)
- Project.DAL (contains IXxxRepositiory and XxxRepository where CRUD is performed on the entity classes)
- Project.Web (the MVC3 project. Controllers transfer data from ViewModels into entity models and call the CRUD functions in the DAL repositories.)
The WebApi
in MVC4
appears so attractive since we will be able to call the CRUD operations from other applications. We all love this idea.
But the existing examples I have found have the CRUD operations inside the MVC4 project under ApiController
. I am used to putting these operations into a separate DAL project. What is the recommended choice? Can we still have a separate DAL class? How do you experts design the architecture?
Thank you for all helpful advice.