Shivprasad Koirala
Shivprasad Koirala

Reputation: 28626

What would be the best way to stucture MVC model and data access layer code?

I am using EF Code first to access data in MVC. What would be best place to put the DbContext and ObjectContext code :-

-- Create a new Folder / Area with a different namespace and put the Code in it.

-- Create a DbContext Dal project outside the MVC project and add reference to it.

Wondering what is the best way ?.

Upvotes: 0

Views: 60

Answers (1)

Koti Panga
Koti Panga

Reputation: 3720

To get advantage of TDD(Test driven design i.e., design on the fly) I would suggest to go with different layers(most importantly it has to happen by keeping an eye on abstraction and separation of concerns. i.e., breaking the system in to its structural-elements, architectural-components, sub-systems, sub-assemblies)

Please follow below great answers(for similar type of questions)

Clean solution (project) structure with EF, Repositories, Entities

Whats a recommended solution structure for a somewhat large website in asp.net

Upvotes: 1

Related Questions