configure<TOptions> method

ServiceCollection configure<TOptions>(
  1. OptionsImplementationFactory<TOptions> instance,
  2. ConfigureOptionsAction<TOptions> configureOptions, {
  3. String? name,
})

Registers an action used to configure a particular type of options.

Implementation

ServiceCollection configure<TOptions>(
  OptionsImplementationFactory<TOptions> instance,
  ConfigureOptionsAction<TOptions> configureOptions, {
  String? name,
}) {
  addOptions<TOptions>(instance);
  addSingleton<ConfigureOptions<TOptions>>(
    (_) => ConfigureNamedOptions0<TOptions>(
      name,
      configureOptions,
    ),
  );
  return this;
}