Extensions to configure Simple Injector on top of IServiceCollection.
Inheritance Hierarchy
SimpleInjectorSimpleInjectorServiceCollectionExtensions
Namespace: SimpleInjector
Assembly: SimpleInjector.Integration.ServiceCollection (in SimpleInjector.Integration.ServiceCollection.dll) Version: 5.0.0
Syntax
The SimpleInjectorServiceCollectionExtensions type exposes the following members.
Methods
Name | Description | |
---|---|---|
![]() ![]() | AddLocalization |
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.
|
![]() ![]() | AddLogging |
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.
|
![]() ![]() | AddSimpleInjector |
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.
|
![]() ![]() | CrossWire(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.
|
![]() ![]() | CrossWireTService(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.
|
![]() ![]() | UseSimpleInjector(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.
|
![]() ![]() | UseSimpleInjector(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.
|
See Also