Hard coded database name in PersistanceInfoProvider

Posts   
 
    
nirataro
User
Posts: 5
Joined: 14-Jun-2006
# Posted on: 14-Jun-2006 16:41:15   

Why does the database name hard-coded in the element mapping in PersistanceInfoProvider.cs ?

We are using multiple version of database names for testing, staging and production and code like this

base.AddElementMapping( "CaseDocumentEntity", "AIESECNG_LAUNCH", @"dbo", "CaseDocument", 4 );

is making switching database name on the fly really difficult.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 14-Jun-2006 16:57:09   

You should use catalog name overwriting or schema name overwriting. See docs -> Using the generated code - Application configuration through .config files. This is already implemented since 1.0.2004.2

Frans Bouma | Lead developer LLBLGen Pro
Brandt
User
Posts: 142
Joined: 04-Apr-2007
# Posted on: 05-Oct-2007 15:16:31   

Otis wrote:

You should use catalog name overwriting or schema name overwriting. See docs -> Using the generated code - Application configuration through .config files. This is already implemented since 1.0.2004.2

Is there a way to change the database name in the designer with out having to recreate the project?

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 05-Oct-2007 15:35:16   

Why does the database name hard-coded in the element mapping in PersistanceInfoProvider.cs ?

Because LLBLGen Pro enables you to map entities from more than one catalog/database, that's why the catalog/database name is maintained/hardcoded in code, to track back which catalog does the field/table belong.

Is there a way to change the database name in the designer with out having to recreate the project?

You can rename the catalog in the Catalog Explorer. But why don't you use catalog name overwrites in your application config file, at least you won't need to regenerate the code and rebuild it.

Brandt
User
Posts: 142
Joined: 04-Apr-2007
# Posted on: 05-Oct-2007 15:37:45   

Is there a way to change the database name in the designer with out having to recreate the project?

You can rename the catalog in the Catalog Explorer. But why don't you use catalog name overwrites in your application config file, at least you won't need to regenerate the code and rebuild it.

One less web config line to get the support personel confused, and a internal struggle to make everything perfect. I will check out the catalog explorer renaming. Thanks Walaa