diff --git a/src/Nancy.Bootstrappers.Ninject/NinjectNancyBootstrapper.cs b/src/Nancy.Bootstrappers.Ninject/NinjectNancyBootstrapper.cs index 7937cd1..93e1da6 100644 --- a/src/Nancy.Bootstrappers.Ninject/NinjectNancyBootstrapper.cs +++ b/src/Nancy.Bootstrappers.Ninject/NinjectNancyBootstrapper.cs @@ -6,6 +6,7 @@ using Nancy.Bootstrapper; using global::Ninject; using global::Ninject.Extensions.ChildKernel; + using global::Ninject.Infrastructure; /// /// Nancy bootstrapper for the Ninject container. @@ -128,9 +129,9 @@ protected override void RegisterInstances(IKernel container, IEnumerable /// Request container instance - protected override sealed IKernel CreateRequestContainer() + protected override IKernel CreateRequestContainer() { - return new ChildKernel(this.ApplicationContainer); + return new ChildKernel(this.ApplicationContainer, new NinjectSettings { DefaultScopeCallback = StandardScopeCallbacks.Singleton }); } /// @@ -144,7 +145,7 @@ protected override sealed IEnumerable GetAllModules(IKernel contai } /// - /// Retreive a specific module instance from the container + /// Retrieve a specific module instance from the container /// /// Container to use /// Type of the module