When I create Entities within the Graphical view of the edmx file. All my entity classes are bundled together in the Designer file. Is there a way to make Entity Framework to create classes in separate files allowing me to have more control over my entity classes?
Share
If you are using Visual Studio 2010, click on the design surface of the EDM Designer and select
Add Code Generation Item, then selectADO.NET POCO Entity Generator. This will create aT4 Templatefile (*.tt) that will be used to generate your POCO classes. Every class will have it’s own file.You have to be aware of the fact that every time you make changes to your EDM and save, those classes will be re-generated and the files will be re-written, so it’s better not to make any changes to them directly. Those classes are
partial, so you can create new files and build up your classes without changing the initial files.