AddOptions

The registration call, services.AddOptions<T>(), that returns an options builder on which binding and validation calls are chained.

In more detail

Each call on it adds one more step, such as binding or a validation rule, to how the options are produced. BindConfiguration("Catalog") binds a section by path and follows reloads; Bind takes a section object you already have.

Example

services.AddOptions<CatalogOptions>().BindConfiguration(CatalogOptions.SectionName)

Related terms

Taught in

References