When using configuration values in an ASP.NET Core Web API, you can either inject IConfiguration, IOptions, or IOptionsSnapshot into your API controller.
We'll inject each one into a controller, test them using an API endpoint to see what they return, and change the configuration values in appsettings.json to see if the change is updated whilst the application is still running.
► Read the tutorial:
https://www.roundthecode.com/dotnet-t...
🎓 .NET tutorials, code examples and coding challenges 🎓
https://www.roundthecode.com/?utm_sou...
► Chapters
0:00 What we'll look at
0:06 Add appsettings
0:29 IConfiguration
4:48 IOptions
6:21 IOptionsSnapshot
7:29 Nested configuration
8:33 Which one to use?
Смотрите видео How should you get config values from appsettings.json? онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Round The Code 15 Июль 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,013 раз и оно понравилось 46 людям.