Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Get Web App Configuration Settings Stored in Database using .NET Core 2.x

$
0
0

I'm still new to .NET, and am struggling with something, and hope someone can help me out...

I'd like to shift some of my web application settings (that are currently in my "appsettings.json" file) out to an existing SQL database. Currently I'm able to use dependency injection and the Entity Framework within my Controllers to access other tables within the SQL database. But how exactly do I go about grabbing configuration settings so I can leverage them directly within the "startup.cs" file?

For example, I'd like to grab some SMTP settings stored within my SQL table, and use them to then configure an email service within the "ConfigureServices" method in "Startup.cs".

Thanks!


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>