Answer the question
In order to leave comments, you need to log in
ASP.NET Core: how many configs should there be for different databases and how to distribute them among controllers?
I have an MVC application that takes the database connection settings from appsettings.json. The controller then uses these settings via IConfiguration.
Now I need to make sure that the application can also connect to another database. How to do it right?
1. Should there be a separate route and controller for the new database?
2. Should there be a separate json file that I will feed to the controller from step 1?
Just for information (if it matters): in the frontend it will be a separate tab. Those. on the first tab data from the first database is issued, and on the new second tab - from the second database.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question