Setup Ninject | MVC

Implement the controller

You first implement the NinjectControllerFactory class that enables Sitefinity CMS and the Classic MVC mode to instantiate controllers that may accept parameters in their constructors:

Register the controller

Next, you implement the Global.asax file that registers the NinjectConrtollerFactory that enables constructor injection in Controllers. This code example demonstrates how to register a new dependency resolver that enables the constructor dependency injection in ApiControllers. In addition, you register routes that enable working in Classic MVC mode and making Web API calls.

For more information, see Classic MVC mode.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?