- Simone Olianti
- SnapObjects
- Monday, 23 September 2019 07:23 PM UTC
Hi there, i wonder if there is a way to pass the connection string which is written in the "appsettings.json" of a web api as an argument during a call from a PB app (i.e. maybe inside the url of a restclient call).
For example i have two ASA connection strings configured like this:
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"start2": "Dsn=start2;uid=dba;pwd=sql",
"s2": "Dsn=s2;uid=dba;pwd=sql"
}
}
in the Startup.cs i've configured the DataContext like this:
// Note: Replace "ContextName" with the configured context name; replace "key" with the database connection name that exists in appsettings.json. The sample code is as follows:
services.AddDataContext m.UseOdbc(Configuration["ConnectionStrings:start2"]));
what i would like to do is to use "start2" or "s2" connection strings dynamically according to some arguments passed
inv_RestClient.sendgetrequest("http://xxx.xxx.xxx.xxx:82/api/dayfat/retrievedsdata?dataoggi=2019-03-29", ls_response)
tia,
simone
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.