Changing Namespace

Posts   
 
    
ogiepogi
User
Posts: 4
Joined: 09-Aug-2006
# Posted on: 29-May-2007 09:24:30   

Hi, Im using v2.0 of LLBLGen, adapter, SQL 2005,.net 2.0. I want to change the Namespace of all the classes that will be found in EntityClasses and EntitySubClasses. Lets say i want to change the namespace of all the classes in EntitySubClasses as "MyCompany.Function.EntitiyClasses.SubEntities", and for the EntityClasses as "MyCompany.Function.EntityClasses.Entities". Is there a way to do it?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 29-May-2007 10:19:51   

For the "MyCompany.Function" part, I think you should set this as the Root NameSpace when you generate the code.

As for the second part of the name space, you can modify the entity code generation templates to use your specific naming convention rather than what's used.

ogiepogi
User
Posts: 4
Joined: 09-Aug-2006
# Posted on: 29-May-2007 10:27:40   

Hello, Thanks for the quick response...

The 2nd part of the NameSpace is what i want to change... what are the templates that i need to edit? what are the affected templates? will the factories will be affected also that i will need to edit them also?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 29-May-2007 10:33:52   

eg. "For .NET 2.0 C# Adapter Two Class Scenario":

Path = <LLBLGen Installation Folder>\Templates\SharedTemplates\Net2.x\C#

EntityClasses template file = entityUsingDerivedAdapter.template EntitySubClasses template file = derivedEntityAdapter.template

Take care that this will affect other template classes that's using (referencing) these namespaces.

eg: derivedEntityFactoriesAdapter.template & inheritanceInfoProviderDerived.template Where you can find the following line in the top of the file: using <[RootNamespace]>.EntityClasses; Which should be changed as well to use the same namespace used for your subEntities.

ogiepogi
User
Posts: 4
Joined: 09-Aug-2006
# Posted on: 29-May-2007 12:32:56   

Hi, I tried editing the entityAdapter.Template, entitiyBase.Template (and also the EntityFactoriesAdapter)

but still the Namespace of the EntityClasses didnt Changed.

jbb avatar
jbb
User
Posts: 267
Joined: 29-Nov-2005
# Posted on: 29-May-2007 15:45:27   

Hello, What Scenario do you use for your generation(to be sure the good files have been modified)?

ogiepogi
User
Posts: 4
Joined: 09-Aug-2006
# Posted on: 30-May-2007 06:46:56   

Hi, Im using 2 class scenario adapter .net 2.0 C#

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 30-May-2007 09:38:48   

Please check my previous post.

hint: EntityClasses template file = entityUsingDerivedAdapter.template EntitySubClasses template file = derivedEntityAdapter.template