Suppose I am creating a application using the sample Northwind database using asp.net mvc 3 and entity framework database first approach. For that I am opening a new asp.net mvc 3 project and then adding a ado.net entity data model. I am generating it from the existing database as it is already created. After that I am using the ado.net DbContext generator to generate codes for me. These includes all the models and the DbContext file(in this case NorthwindContext).
Now the problem that I am facing is in reorganizing the code. All the models should be placed in the Model folder of the project. Even if i generate the codes in the Model folder the NorthwindContext class is also generated in it. That is under the NorthwindContext.tt file a NorthwindContext.cs is generated. This file should reamin in the DAL folder as I will use it for accessing the data. Now if i just drag an drop it into the DAL folder the code generation stops automatically(no code remains in the NorthwindContext.cs file). Any idea how i can resolve this problem?????