changing namespaces in Fluent nHibernate and classes preset

Posts   
 
    
Robert.W
User
Posts: 79
Joined: 19-Jun-2007
# Posted on: 29-Oct-2010 07:49:46   

Hi,

Is it possible to change namespaces entities and value types get generated in when using Fluent nHibernate and classes preset? I would like them to all go into a single namespace like *.Model instead of being split into *.Model.EntityClasses *.Model.ValueTypes. I know how to modify the preset to get rid of the folders but haven't found a way to modify namespaces.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 29-Oct-2010 10:49:13   

You may edit the templates, using Template Editor built-in inside the Designer.

But may I ask why do you want to combine these under the same namespace?

T0M
User
Posts: 7
Joined: 09-Nov-2009
# Posted on: 29-Oct-2010 10:53:08   

Robert,

The namespaces are (unfortunately) hard-coded in the templates, so editing these is your only option.

I've started a topic about the hard-coding a couple of months ago (may '10 simple_smile ) here: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=17930

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 29-Oct-2010 14:11:09   

The namespaces are hardcoded so other code knows where the entity classes / value types are located. We can add settings for that, but it's not of a high priority at the moment. We chose to separate them in their own namespaces to make things be grouped together better, as valuetype classes are different things than entity classes.

Frans Bouma | Lead developer LLBLGen Pro
Robert.W
User
Posts: 79
Joined: 19-Jun-2007
# Posted on: 29-Oct-2010 14:43:51   

Thanks for all your replies. I was afraid the only way to go is to modify the templates - something I will probably choose not to do just to get the namespaces I want.

The reason I want both value types and entities them in the same namespace is really a matter of personal preferences more than anything else. I never used distinct namespaces when hand coding and was wondering if I could keep it this way. I don't really like EntityClasses or ValueTypes - too much details IMO - I prefer to have it all in a *.Model namespace (one less using simple_smile ).

All in all not a big drawback and I'm still happy with NHibernate support so far, so I guess I'll just have to get used to it.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 29-Oct-2010 17:12:29   

I've added a workitem (low priority) for 3.2, so we'll look at it then and decide whether we'll add the ability to set this in the designer.

Frans Bouma | Lead developer LLBLGen Pro