...

/

Packaging Configuration Data into Classes

Packaging Configuration Data into Classes

In this lesson, we will learn how to organize configuration data into classes that will be available through dependency injection.

It is not desirable that various application parts access the whole configuration as this may create hidden dependencies between application subparts. For instance, a controller might use a pager setting that was conceived for another section of the website, so changing the configuration for that section might unexpectedly change the behavior of other application sections as well.

Configuration sections help to organize data, but we need a way to inject data from a single section preventing access to other sections. It is best to have controllers and views receive data already converted into C# types so they don’t have to convert from strings. The ASP.NET Core options framework solves this problem.

The ...

Access this course and 1400+ top-rated courses and projects.