示例#1
0
        protected override IKernel CreateKernel()
        {
            Logger.Info("NzbDrone Starting up.");
            var dispatch = new CentralDispatch();
            dispatch.DedicateToHost();

            dispatch.Kernel.Load(Assembly.GetExecutingAssembly());
            return dispatch.Kernel;
        }
示例#2
0
        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));
        }
示例#3
0
        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();
        }