SimpleInjectorAspNetCoreMvcIntegrationExtensionsRegisterPageModels Method

Simple Injector

Note: This API is now obsolete.

Registers the ASP.NET Core MVC controller instances that are defined in the application through the ApplicationPartManager.

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

[ObsoleteAttribute("Please use SimpleInjectorAspNetCoreBuilderMvcExtensions.AddPageModelActivation instead—e.g. 'services.AddSimpleInjector(container, options => options.AddPageModelActivation());'. Please see for more details. Will be treated as an error from version 5.0. Will be removed in version 6.0.", 
public static void RegisterPageModels(
	this Container container,
	IApplicationBuilder applicationBuilder


Type: SimpleInjectorContainer
The container the controllers should be registered in.
Type: IApplicationBuilder
The ASP.NET object that holds the application's configuration.

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