SimpleInjectorAspNetCoreIntegrationExtensionsCrossWire Method (Container, Type, IApplicationBuilder)

Simple Injector

Note: This API is now obsolete.

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 the container.

Namespace:  SimpleInjector
Assembly:  SimpleInjector.Integration.AspNetCore (in SimpleInjector.Integration.AspNetCore.dll) Version: 4.10.3

[ObsoleteAttribute("Please call services.AddSimpleInjector(options => { options.CrossWire(typeof(YourType)); }) instead. AddSimpleInjector can be called from within the ConfigureServices method of the Startup class. See for more information. Will be removed in version 5.0.", 
public static void CrossWire(
	this Container container,
	Type serviceType,
	IApplicationBuilder builder


Type: SimpleInjectorContainer
The container.
Type: SystemType
The type of service object to ross-wire.
Type: IApplicationBuilder
The IApplicationBuilder to retrieve the service object from.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Container. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also