• Code
  • Tags
  • Users
  • Titles
  • Log in
  • Feedback
  • FAQ
Share Code
Welcome to ForkCan.com

ForkCan is all about sharing code in a social way.

Discuss, debate or argue with other devs about their or your own code.

Give other devs feedback or make a Fork (Make a better version of a shared code).

Rate the code, if you use the code mark it as used so others can see if the shared code is used by someone.

Help each other to be better devs and to be more productive.


Features not working yet:

Flag a post


QR Code

Tiny Url

http://4kcan.com/s/MzQ1

Related Code
MVC NinjectControllerFactory

MVC NinjectControllerFactory

A controller factory for Ninject

1
520 0 0 0 0 0

public class NinjectControllerFactory : IControllerFactory
{
    public IController CreateController(RequestContext context, 
        string controllerName)
    {
        string typeName = 
            "MvcApplication.Controllers." + controllerName + "Controller";

        Type controllerType = 
            typeof(HomeController).Assembly.GetType(typeName, true, true);

        return Kernel.Get(controllerType);
    }
}

// Application startup   
ControllerBuilder.Current.SetDefaultControllerFactory(
    typeof(NinjectControllerFactory));

Share: twitter | facebook   Action: used | fork | flag

depdencency-injection

Mark 'depdencency-injection' tag as 'like'

Mark 'depdencency-injection' tag as 'ignore'

mvc

Mark 'mvc' tag as 'like'

Mark 'mvc' tag as 'ignore'

ninject

Mark 'ninject' tag as 'like'

Mark 'ninject' tag as 'ignore'


 Steven
500
November 05, 2010 5:22 PM

Fork

 MVC NinjectControllerFactory - Steven Friday 05, 2010 5:22 PM


0 Feedback


You must log in before you can give any feedback


0 Discussion(s)

Newest Oldest

You must log in before you can post a comment

Squeed
Made by: Fredrik Normén 2010