protected override IKernel CreateKernel() { Logger.Info("NzbDrone Starting up."); var dispatch = new CentralDispatch(); dispatch.DedicateToHost(); dispatch.Kernel.Load(Assembly.GetExecutingAssembly()); return dispatch.Kernel; }
private void InitContainer() { logger.Info("NzbDrone Starting up."); var dispatch = new CentralDispatch(); dispatch.ContainerBuilder.RegisterAssemblyTypes(typeof(MvcApplication).Assembly).SingleInstance(); dispatch.ContainerBuilder.RegisterAssemblyTypes(typeof(MvcApplication).Assembly).AsImplementedInterfaces().SingleInstance(); MVCRegistration(dispatch.ContainerBuilder); var container = dispatch.ContainerBuilder.Build(); DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); }
private void InitContainer() { Logger.Info("NzbDrone Starting up."); var dispatch = new CentralDispatch(); dispatch.DedicateToHost(); dispatch.ContainerBuilder.RegisterAssemblyTypes(typeof(MvcApplication).Assembly).SingleInstance(); dispatch.ContainerBuilder.RegisterAssemblyTypes(typeof(MvcApplication).Assembly).AsImplementedInterfaces().SingleInstance(); MVCRegistration(dispatch.ContainerBuilder); var container = dispatch.BuildContainer(); DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); //SignalR RouteTable.Routes.MapHubs(); //ServiceStack dispatch.ContainerBuilder.RegisterType<MemoryCacheClient>().As<ICacheClient>().SingleInstance(); dispatch.ContainerBuilder.RegisterType<SessionFactory>().As<ISessionFactory>().SingleInstance(); new AppHost(container).Init(); }