SimpleInjectorGenericHostExtensionsUseSimpleInjector Method (IHost, Container)

Simple Injector
Finalizes the configuration of Simple Injector on top of IHost. Ensures framework components can be injected into Simple Injector-resolved components, unless AutoCrossWireFrameworkComponents is set to false.

Namespace:  SimpleInjector
Assembly:  SimpleInjector.Integration.GenericHost (in SimpleInjector.Integration.GenericHost.dll) Version: 5.0.0
Syntax

public static IHost UseSimpleInjector(
	this IHost host,
	Container container
)

Parameters

host
Type: IHost
The application's IHost.
container
Type: SimpleInjectorContainer
The application's Container instance.

Return Value

Type: IHost
The supplied host.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IHost. 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 host or container are null references.
See Also

Reference