user428745
user428745

Reputation: 853

Ninject - basic use

I have a class with Ninject

but I don't know Ninject so hight.

Why always must type this method?

protected override IController GetControllerInstance(
  System.Web.Routing.RequestContext requestContext, 
  System.Type controllerType)
{
  return controllerType == null 
    ? null 
    : (IController)ninjectKernel.Get(controllerType);
}

Upvotes: 0

Views: 100

Answers (1)

Richard Schneider
Richard Schneider

Reputation: 35477

Ninject is an IOC (Inversion of Control) package.

The code you are always typing, asks the Ninject container to find the controller for the specified type.

Upvotes: 1

Related Questions