Page 1 of 1

Generate files to subfolders based on namespace

Posted: Thu 25 Apr 2019 20:20
by ispcdev
Is it possible to generate the class files to subfolders based on namespace? For example, if given the following:

Code: Select all

Class   Namespace                  Subfolder
Foo     MyCompany.Data.Something   ProjectRoot\Data\Something
Bar     MyCompany.Data.OtherThing  ProjectRoot\Data\OtherThing
Thanks

Re: Generate files to subfolders based on namespace

Posted: Wed 01 May 2019 08:44
by Shalex
An existing functionality doesn't allow generating every class in its subfolder. You should modify output.PushOutputRedirection in a predefined template to change code generation.

Entity Developer code generator system is based on its own object model and uses T4-like template language: https://www.devart.com/entitydeveloper/ ... ation.html. Our documentation doesn't include reference for classes used in the templates, but there are some tips:
* use IntelliSense feature in our T4 Editor (completion list appears when you type the '.' character)
* the Properties window in design time includes descriptions of model objects members
* general T4 reference: https://docs.microsoft.com/en-us/visual ... ew=vs-2019
* decompiling these assemblies may help you to get acquainted with the needed classes and their functionality
C:\Program Files (x86)\Common Files\Devart\EntityDeveloper\EntityDeveloper.Common.dll (includes the EntityDeveloper.TemplateEngine.Output class)
C:\Program Files (x86)\Common Files\Devart\EntityDeveloper\EntityDeveloper.Orm.Common.dll
C:\Program Files (x86)\Common Files\Devart\EntityDeveloper\EntityDeveloper.Orm.NHibernate.dll

Re: Generate files to subfolders based on namespace

Posted: Fri 03 May 2019 10:16
by Shalex
JIC
here is a solution for a similar task but for another ORM (use HibernateClass instead of EntityClass): viewtopic.php?t=26144

Re: Generate files to subfolders based on namespace

Posted: Tue 07 May 2019 12:46
by ispcdev
Thank you. I will take a look.