Inject GroupName into Namespace of created entities

Posts   
 
    
aaswin
User
Posts: 4
Joined: 21-Sep-2013
# Posted on: 21-Sep-2013 02:39:10   

How can I inject the group name into the namespace of generated entity?

Right now all the entities are dumped into into a single namespace. There is just no way to distinguish an entity that belongs to a certain group from another in the consumer side.

While we're on the topic how can I make LLBLgen generates different namespace for entities generated from different databases? I am hoping I could plug them into different groups, and then generate the entities accordingly, but may be there's a more elegant way?

However the database name should not be part of the entity or its namespace, since we have multi tenant architecture. So the donor database used for codegen will not be the same one as live, hence I don't want to code against anything named after the donor db as that will just serve to create confusion.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 21-Sep-2013 09:45:12   

Groups can be used either for visual separation in the designer or to generate entities in separate projects. If you wish to have separate projects you will need to alter the Project Setting "Group Usage" under Project Settings\General\Designer Behavior.

While we're on the topic how can I make LLBLgen generates different namespace for entities generated from different databases? I am hoping I could plug them into different groups, and then generate the entities accordingly, but may be there's a more elegant way?

You may fiddle with the code generation templates to use <[ElementTargetCatalogName]> or <[ElementTargetSchemaName]> in the entity class definition as well as other templates which access entities. Though I don't recommend this path.

aaswin
User
Posts: 4
Joined: 21-Sep-2013
# Posted on: 24-Sep-2013 20:42:14   

Walaa wrote:

Groups can be used either for visual separation in the designer or to generate entities in separate projects. If you wish to have separate projects you will need to alter the Project Setting "Group Usage" under Project Settings\General\Designer Behavior.

While we're on the topic how can I make LLBLgen generates different namespace for entities generated from different databases? I am hoping I could plug them into different groups, and then generate the entities accordingly, but may be there's a more elegant way?

You may fiddle with the code generation templates to use <[ElementTargetCatalogName]> or <[ElementTargetSchemaName]> in the entity class definition as well as other templates which access entities. Though I don't recommend this path.

That seems to do it, thanks.