Showing posts with label IConfiguration. Show all posts
Showing posts with label IConfiguration. Show all posts

Friday, April 10, 2020

Access config settings directly from class library

In the previous post we saw on how to access the config settings by creating a custom class and injecting it in the startup, so that it can be used in the controllers. In this case the startup and the controller classes are in the same project.

Access config settings using custom class

In the previous post we saw on how to use Dependency Injection to get the configuration options in the Controller classes. In this post we will see another way of reading the configuration setting using a custom class.

Access config settings from appsetting.json in Controller using DI

In the previous post we saw the options to read config setting values in Startup, in this post we shall see on how to get the config setting values in the controller. We will inject the configuration object to the service and the same will be made available in the Controller using Dependency Injection.