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:
.NET tutorials, code examples and coding challenges
► 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?