Configuration through code

Posts   
 
    
yowl
User
Posts: 271
Joined: 11-Feb-2008
# Posted on: 14-Sep-2017 16:58:08   

hi,

I am sharing some projects between old style Asp.Net and AspNetCore (.net Framework, not .Net Core). Without a web.config in AspNetCore I want to configure in code and set

<sqlServerCatalogNameOverwrites>
    <add key="OldNameCatalog1" value="NewNameCatalog1" />
    <add key="OldNameCatalog2" value="NewNameCatalog2" />
</sqlServerCatalogNameOverwrites>

How do I do that?

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39763
Joined: 17-Aug-2003
# Posted on: 15-Sep-2017 10:21:45   

In adapter or selfservicing? In adapter you can define catalog overwrites in code per call and globally. See: https://www.llblgen.com/Documentation/5.2/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/Adapter/gencode_dataaccessadapter_adapter.htm#multi-tenancy-support-catalog-specific-persistence-info-sql-server-mysql

In v5.3 (currently in EAP) we added a 'RuntimeConfiguration' class which allows configuration of eveything you can configure in the config files also in code in 1 place (.net core and .net full).

Frans Bouma | Lead developer LLBLGen Pro
yowl
User
Posts: 271
Joined: 11-Feb-2008
# Posted on: 15-Sep-2017 14:12:57   

Thanks, Adapter, I missed that in the docs but that is what I was looking for. My impatience got the better of me. When you search for something at

https://www.llblgen.com/Documentation/5.2/LLBLGen%20Pro%20RTF/

like "configure code". You initially get a "Sorry, page not found" before the right hand side renders the results, and as I've been having problems with a slow connection I didn't wait long enough.

Good news on 5.3, look forward to it.