Skip to content

ServiceCollectionExtensions

public static class ServiceCollectionExtensions

Namespace: RhoMicro.BindSight

Inheritance:

Provides extension methods for IServiceCollection.

public static BindSightBuilder AddBindSight(this IServiceCollection services)

Adds options docs services to the service collection.

NameTypeDescription
servicesIServiceCollectionThe service collection to add options docs services to.

A builder for configuring options docs services.

AddDocumentedOptions<TOptions>(IServiceCollection, string, Action<BinderOptions>)
Section titled “AddDocumentedOptions<TOptions>(IServiceCollection, string, Action<BinderOptions>)”
public static OptionsBuilder<TOptions> AddDocumentedOptions<TOptions>(this IServiceCollection services, string configSectionPath, [Action<BinderOptions>? configureBinder = null]) where TOptions : class

Gets an options builder that forwards Configure calls for the same TOptions to the underlying service collection. Documentation services for the options are registered as well.

NameDescriptionConstraints
TOptionsThe options type to be configured.class
NameTypeDescription
configSectionPathStringThe name of the configuration section to bind from.
configureBinderAction<BinderOptions>Optional. Used to configure the BinderOptions.
servicesIServiceCollectionThe IServiceCollection to add the services to.

The OptionsBuilder<TOptions> so that configure calls can be chained in it.

AddDocumentedOptions<TOptions>(IServiceCollection, string, string, Action<BinderOptions>)
Section titled “AddDocumentedOptions<TOptions>(IServiceCollection, string, string, Action<BinderOptions>)”
public static OptionsBuilder<TOptions> AddDocumentedOptions<TOptions>(this IServiceCollection services, string name, string configSectionPath, [Action<BinderOptions>? configureBinder = null]) where TOptions : class

Gets an options builder that forwards Configure calls for the same TOptions to the underlying service collection. Documentation services for the options are registered as well.

NameDescriptionConstraints
TOptionsThe options type to be configured.class
NameTypeDescription
configSectionPathStringThe name of the configuration section to bind from.
configureBinderAction<BinderOptions>Optional. Used to configure the BinderOptions.
nameStringThe name of the options instance.
servicesIServiceCollectionThe IServiceCollection to add the services to.

The OptionsBuilder<TOptions> so that configure calls can be chained in it.