Provides programmatic configuration for the Simple Injector on top of IServiceCollection.
Inheritance Hierarchy
SimpleInjector.AdvancedApiObject
SimpleInjector.Integration.ServiceCollectionSimpleInjectorAddOptions
Namespace: SimpleInjector.Integration.ServiceCollection
Assembly: SimpleInjector.Integration.ServiceCollection (in SimpleInjector.Integration.ServiceCollection.dll) Version: 5.0.0
Syntax
The SimpleInjectorAddOptions type exposes the following members.
Properties
Name | Description | |
---|---|---|
![]() | AutoCrossWireFrameworkComponents |
Gets or sets a value indicating whether or not Simple Injector should try to load framework
components from the framework's configuration system or not. The default is true.
|
![]() | Container |
Gets the Container instance used by the application.
|
![]() | DisposeContainerWithServiceProvider |
Gets or sets the value indicating whether the Container instance ued by the
application should be disposed when the framework's IServiceProvider is disposed.
The IServiceProvider is typically disposed of on application shutdown, which is also
the time to dispose the Container. The default value is true.
|
![]() | ServiceProviderAccessor |
Gets or sets an IServiceProviderAccessor instance that will be used by Simple
Injector to resolve cross-wired framework components.
|
![]() | Services |
Gets the IServiceCollection that contains the collection of framework components.
|
Methods
Name | Description | |
---|---|---|
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from ApiObject.) |
![]() | GetHashCode | Serves as the default hash function. (Inherited from ApiObject.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from ApiObject.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from ApiObject.) |
Extension Methods
Name | Description | |
---|---|---|
![]() | AddAspNetCore |
Adds basic Simple Injector integration for ASP.NET Core and returns a builder object that allow
additional integration options to be applied. These basic integrations includes wrapping each web
request in an AsyncScopedLifestyle scope and making the nessesary changes that make
it possible for enabling the injection of framework components in Simple Injector-constructed
components when
UseSimpleInjector(IServiceProvider, Container)
is called.
(Defined by SimpleInjectorAddOptionsAspNetCoreExtensions.) |
![]() | AddHostedServiceTHostedService |
Registers the given THostedService in the Container as Singleton and
adds it to the host's pipeline of hosted services.
(Defined by SimpleInjectorGenericHostExtensions.) |
![]() | 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.
(Defined by SimpleInjectorServiceCollectionExtensions.) |
![]() | 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.
(Defined by SimpleInjectorServiceCollectionExtensions.) |
![]() | CrossWire(Type) | Overloaded.
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.
(Defined by SimpleInjectorServiceCollectionExtensions.) |
![]() | CrossWireTService | Overloaded.
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.
(Defined by SimpleInjectorServiceCollectionExtensions.) |
See Also