concept iconfigureoption in category asp.net
appears as: IConfigureOptions, IConfigureOptions

This is an excerpt from Manning's book ASP.NET Core in Action.
In the second scenario, you want to configure a strongly typed IOptions object with values returned from a service. But the service won’t be available until after you’ve configured all of the IOptions objects. In section 19.2.2, you’ll see how to handle this by implementing the IConfigureOptions interface.
ASP.NET Core provides this mechanism with the IConfigureOptions<T> interface. You implement this interface in a configuration class and use it to configure the IOptions<T> object in any way you need. This class can use DI, so you can easily use any other required services.
Listing 19.9. Implementing IConfigureOptions<T> to configure an options object
public class ConfigureCurrencyOptions : IConfigureOptions<CurrencyOptions> { private readonly ICurrencyProvider _currencyProvider; #1 public ConfigureCurrencyOptions(ICurrencyProvider currencyProvider) { _currencyProvider = currencyProvider; #1 } public void Configure(CurrencyOptions options) #2 { options.Currencies = _currencyProvider.GetCurrencies(); #3 } } #1 You can inject services that are only available after the DI is completely configured. #2 Configure is called when an instance of IOptions <CurrencyOptions> is required. #3 You can use the injected service to load the values from a remote API, for example. !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":2,\"ch\":73},{\"line\":2,\"ch\":75}],[{\"line\":5,\"ch\":73},{\"line\":5,\"ch\":75}],[{\"line\":14,\"ch\":0},{\"line\":14,\"ch\":2}],[{\"line\":2,\"ch\":73},{\"line\":2,\"ch\":75}],[{\"line\":5,\"ch\":73},{\"line\":5,\"ch\":75}],[{\"line\":14,\"ch\":0},{\"line\":14,\"ch\":2}],[{\"line\":8,\"ch\":73},{\"line\":8,\"ch\":75}],[{\"line\":15,\"ch\":0},{\"line\":15,\"ch\":2}],[{\"line\":10,\"ch\":73},{\"line\":10,\"ch\":75}],[{\"line\":16,\"ch\":0},{\"line\":16,\"ch\":2}]]"} !@%STYLE%@!