I have a shared the library that needs some input from the config file, let’s say a database helper class with IConfiguration injected in the constructor.
I have an ASP.Net core that uses appsettings.json with database connection string. And there is also a core Console app that uses App.config to provide database connection string. Both of them use the helper class.
However IConfigration only supports appsettings.json format eg. configuration.GetConnectionString. Is there a way to be able to read from both app.config and appsettings.json in a uniformed code?