0

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 ?.

Shivprasad Koirala
  • 27,644
  • 7
  • 84
  • 73

1 Answers1

1

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

Community
  • 1
  • 1
Koti Panga
  • 3,660
  • 2
  • 18
  • 21