c# - Costumize DbContext using connection string from ServiceConfiguration (Azure) -
I'm using the unit-outline code first approach and I have custom DbContext I have my connectionstring ServiceConfiguration.Cloud .cscfg and ServiceConfiguration.Local.cscfg files are defined in
Public CustomContext ():. The base ("dbActivity") {... When executing the above code, it tries to check the ServiceConfiguration file from my web.config and not a blue solution
Update:. Here is my connectionstring in the ServiceConfiguration file: & lt; Configuration Settings & gt; & Lt; Setting name = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value = "UseDevelopmentStorage = true" /> & Lt; Installation name = "dbActivity" value = "server = TCP: xxx.database.windows.net, 1433; database = ra; user id = user, password = password; trusted_Connection = false; encrypt = true; connection timeout = 30," / & Gt; & Lt; / ConfigurationSettings & gt; Exception:
No connection string 'server = TCP named: xxx.database.windows.net, 1433; Database = ra; User id = user, password = password; TrustedConconction = Fault; Encrypt = true; Connection timeout = 30; The application can be found in the config file. "
Is it possible to check ServiceConfiguration.Local.cscfg instead?
Finally I need to use this SqlConnectionStringBuilder class.
"DbRAActivity"). ToString ()) {}
Comments
Post a Comment