File Per Class False Does Not Generate Code

File Per Class False Does Not Generate Code

Postby petercbaxter » Tue 10 Jan 2017 18:58

In ED 6.0.157, I am trying to minimize the number of output CS files generated from my model. I am using the Telerik Data Access ORM.

If I turn "File Per Class" to true, then I get about 100 class.cs files (one per table) and 100 class.metadatasource.cs files (also one per table). If I turn "File Per Class" to false, I am expecting one .cs file and one metadatasource.cs file, but instead the output folder contains no, as in 0/ZERO, files are generated.

So, is the "File Per Class" equal FALSE broken? Or, am I using it incorrectly?

But more importantly, what parameters can I use to get the minimum number of output files from ED?

Peter
petercbaxter
 
Posts: 2
Joined: Tue 10 Jan 2017 18:53

Re: File Per Class False Does Not Generate Code

Postby Shalex » Tue 10 Jan 2017 19:44

petercbaxter wrote:If I turn "File Per Class" to false, I am expecting one .cs file and one metadatasource.cs file, but instead the output folder contains no, as in 0/ZERO, files are generated.
We cannot reproduce the problem at the moment.

The only file generated in this case is ModelName.Designer.cs (designed behaviour). Please move any entity on the diagram (it will be marked with asterisk as modified) and save it to run custom tool of the model. Is ModelName.Designer.cs generated in this case?
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44

Re: File Per Class False Does Not Generate Code

Postby petercbaxter » Mon 06 Feb 2017 14:14

Ok, I understand that the flag "OneFIlePerClass" is inconsistently implemented (or documented ;) so that when it is TRUE, ED generates files with the pattern {class}.cs and when it is FALSE, it generates {MODEL}.Designer.cs.

So, the only options for controlling the number of files generated is to use the "OneFilePerClass" flag? Are there any other options? Additionally, is there a way to run a post-processing script so I can merge all the metadata files into one? (What I want is a single metadata file -- since noone looks at that) and individual class files.

Thank you for your help.
petercbaxter
 
Posts: 2
Joined: Tue 10 Jan 2017 18:53

Re: File Per Class False Does Not Generate Code

Postby Shalex » Thu 09 Feb 2017 17:10

petercbaxter wrote:Ok, I understand that the flag "OneFIlePerClass" is inconsistently implemented (or documented ;) so that when it is TRUE, ED generates files with the pattern {class}.cs and when it is FALSE, it generates {MODEL}.Designer.cs.
If File Per Class is set to False, all model classes with metadata information will be placed into a single file.

petercbaxter wrote:Additionally, is there a way to run a post-processing script so I can merge all the metadata files into one? (What I want is a single metadata file -- since noone looks at that) and individual class files.
Right click template in Model Explorer > Templates, select Copy to Model Folder. Now you can modify a predefined code generation template in a way you need.

Tips:
1) documentation: http://www.devart.com/entitydeveloper/entitydeveloper.chm (download, right click > Unblock) > the "Template System Concepts" section
2) you can use IntelliSense feature in our T4 Editor (completion list appears when you type the '.' character)
3) decompiling C:\Program Files (x86)\Common Files\Devart\EntityDeveloper\EntityDeveloper.Common.dll and C:\Program Files (x86)\Common Files\Devart\EntityDeveloper\EntityDeveloper.Orm.Common.dll may help you to get acquainted with the needed classes and their functionality
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44


Return to Entity Developer