Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Container Support

JefClaes edited this page Mar 23, 2013 · 9 revisions

Ninject

First, download the Nancy.Bootstrappers.Ninject package. Then, make your custom bootstrapper inherit from NinjectNancyBootstrapper instead of DefaultNancyBootstrapper. And finally, override the ConfigureRequestContainer method, and bind your dependencies.

public class Bootstrapper : NinjectNancyBootstrapper
{             
    protected override void ConfigureRequestContainer(
         IKernel container, NancyContext context)
    {
        container.Bind<ICommandHandler>().To<CommandHandler>();
    }    
}

More to come

Clone this wiki locally