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.

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?