Generate files to subfolders based on namespace

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
ispcdev
Posts: 4
Joined: Thu 25 Apr 2019 19:50

Generate files to subfolders based on namespace

Post by ispcdev » Thu 25 Apr 2019 20:20

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

Shalex
Site Admin
Posts: 8790
Joined: Thu 14 Aug 2008 12:44

Re: Generate files to subfolders based on namespace

Post by Shalex » Wed 01 May 2019 08:44

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

Shalex
Site Admin
Posts: 8790
Joined: Thu 14 Aug 2008 12:44

Re: Generate files to subfolders based on namespace

Post by Shalex » Fri 03 May 2019 10:16

JIC
here is a solution for a similar task but for another ORM (use HibernateClass instead of EntityClass): viewtopic.php?t=26144

ispcdev
Posts: 4
Joined: Thu 25 Apr 2019 19:50

Re: Generate files to subfolders based on namespace

Post by ispcdev » Tue 07 May 2019 12:46

Thank you. I will take a look.

Post Reply