SimpleInjectorServiceCollectionExtensionsCrossWireTService Method (SimpleInjectorAddOptions)

Simple Injector
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: 5.0.0
Syntax

public static SimpleInjectorAddOptions CrossWire<TService>(
	this SimpleInjectorAddOptions options
)
where TService : class

Parameters

options
Type: SimpleInjector.Integration.ServiceCollectionSimpleInjectorAddOptions
The options.

Type Parameters

TService
The type of service object to cross-wire.

Return Value

Type: SimpleInjectorAddOptions
The supplied options.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type SimpleInjectorAddOptions. 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 the parameter is a null reference.
See Also

Reference