SimpleInjectorServiceCollectionExtensions Methods

Simple Injector

The SimpleInjectorServiceCollectionExtensions type exposes the following members.

Methods

  NameDescription
Public methodStatic memberAddLocalization
Allows components that are built by Simple Injector to depend on the (non-generic) Microsoft.Extensions.Localization.IStringLocalizer abstraction. Components are injected with an contextual implementation. Using this method, application components can simply depend on IStringLocalizer instead of its generic counter part, IStringLocalizer<T>, which simplifies development.
Public methodStatic memberAddLogging
Allows components that are built by Simple Injector to depend on the (non-generic) Microsoft.Extensions.Logging.ILogger abstraction. Components are injected with an contextual implementation. Using this method, application components can simply depend on ILogger instead of its generic counter part, ILogger<T>, which simplifies development.
Public methodStatic memberAddSimpleInjector
Sets up the basic configuration that allows Simple Injector to be used in frameworks that require the use of IServiceCollection for registration of framework components. In case of the absense of a DefaultScopedLifestyle, this method will configure AsyncScopedLifestyle as the default scoped lifestyle. In case a setupAction is supplied, that delegate will be called that allow further configuring the container.
Public methodStatic memberCrossWire(SimpleInjectorAddOptions, Type)
Cross wires an ASP.NET Core or third-party service to the container, to allow the service to be injected into components that are built by Simple Injector.
Public methodStatic memberCrossWireTService(SimpleInjectorAddOptions)
Cross wires an ASP.NET Core or third-party service to the container, to allow the service to be injected into components that are built by Simple Injector.
Public methodStatic memberUseSimpleInjector(IServiceProvider, Container)
Finalizes the configuration of Simple Injector on top of IServiceCollection. Will ensure framework components can be injected into Simple Injector-resolved components, unless AutoCrossWireFrameworkComponents is set to false.
Public methodStatic memberUseSimpleInjector(IServiceProvider, Container, ActionSimpleInjectorUseOptions)
Finalizes the configuration of Simple Injector on top of IServiceCollection. Will ensure framework components can be injected into Simple Injector-resolved components, unless AutoCrossWireFrameworkComponents is set to false using the setupAction.
Top
See Also

Reference