Use ASP.NET Core Options with an instance
ASP.NET Core provides a built-in mechanism for configuring an application’s options using the Options pattern. This pattern allows you to define a class to represent the options you want to configure, and then bind those options to values from a variety of sources, such as configuration files, environment variables, or command-line arguments.
Read Blog Post