SimpleInjectorServiceCollectionExtensionsCrossWire Method (SimpleInjectorUseOptions, Type)

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 Simple Injector.

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

[ObsoleteAttribute("Please call services.AddSimpleInjector(options => { options.CrossWire(Type); } instead on the IServiceCollection instance (typically from inside your Startup.ConfigureServices method). For more information, see: https://simpleinjector.org/servicecollection. Will be removed in version 5.0.", 
	true)]
public static SimpleInjectorUseOptions CrossWire(
	this SimpleInjectorUseOptions options,
	Type serviceType
)

Parameters

options
Type: SimpleInjectorSimpleInjectorUseOptions
The options.
serviceType
Type: SystemType
The type of service object to ross-wire.

Return Value

Type: SimpleInjectorUseOptions
The supplied options.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type SimpleInjectorUseOptions. 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).
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when one of the parameters is a null reference.
See Also

Reference