/// <summary> /// Loads the container specific modules. /// </summary> protected override void LoadModules() { IKernel kernel = ((NinjectAdapter)Adapter).Kernel; BuildManager.ConcreteTypes .Where(type => moduleType.IsAssignableFrom(type) && type.HasDefaultConstructor()) .Except(kernel.GetModules().Select(c => c.GetType())) .Each(type => kernel.Load(new[] { Activator.CreateInstance(type) as IModule })); }
/// <summary> /// Initializes a new instance of the <see cref="NinjectAdapter"/> class. /// </summary> /// <param name="kernel">The kernel.</param> public NinjectAdapter(IKernel kernel) { Invariant.IsNotNull(kernel, "kernel"); Kernel = kernel; }
public NinjectContainerAdapter(global::Ninject.IKernel kernel) { this.kernel = kernel; }