SimpleInjectorAspNetCoreIntegrationExtensionsEnableSimpleInjectorCrossWiring Method

Simple Injector

Note: This API is now obsolete.

Enables ASP.NET Core services to be cross-wired in the Container. This method should be called in the ConfigureServices method of the application's Startup class. When cross-wiring is enabled, individual cross-wire registrations can be made by calling CrossWireTService(Container, IApplicationBuilder).

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

[ObsoleteAttribute("Please call services.AddSimpleInjector() instead. AddSimpleInjector can be called from within the ConfigureServices method of the Startup class. See https://simpleinjector.org/aspnetcore for more information. Will be removed in version 5.0.", 
	true)]
public static void EnableSimpleInjectorCrossWiring(
	this IServiceCollection services,
	Container container
)

Parameters

services
Type: IServiceCollection
The ASP.NET application builder instance that references all framework components.
container
Type: SimpleInjectorContainer
The container.

Usage Note

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

Reference