SimpleInjectorServiceCollectionExtensions Class

Simple Injector
Extensions to configure Simple Injector on top of IServiceCollection.
Inheritance Hierarchy

SystemObject
  SimpleInjectorSimpleInjectorServiceCollectionExtensions

Namespace:  SimpleInjector
Assembly:  SimpleInjector.Integration.ServiceCollection (in SimpleInjector.Integration.ServiceCollection.dll) Version: 4.6.0
Syntax

public static class SimpleInjectorServiceCollectionExtensions

The SimpleInjectorServiceCollectionExtensions type exposes the following members.

Methods

  NameDescription
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(SimpleInjectorUseOptions, 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(SimpleInjectorUseOptions)
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 memberUseLogging
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 memberUseSimpleInjector
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