Beispiel #1
0
        /*    protected void Application_Stop()
         *  {
         *                  StopTasks();
         * //            SqlDependency.Stop(GetSpecialistWebConnectionString());
         *
         *  }*/

        protected virtual void InitializeContainer()
        {
            if (Container == null)
            {
                Container = new UnityContainer();

                UnityRegistrator.RegisterControls(Container,
                                                  typeof(HomeController).Assembly);
                UnityRegistrator.RegisterServices(Container);
                Container
                .RegisterType <ISimplePageVMService, SimplePageVMService>()
                .RegisterInstance(typeof(IMetaDataProvider), MetaDataProvider)
                .RegisterType <IAnnounceService, AnnounceService>()
                .RegisterType <ISectionVMService, SectionVMService>()
                .RegisterType <ICourseVMService, CourseVMService>();
                Container.Configure <Interception>()
                .SetDefaultInterceptorFor <CourseVMService>(
                    new VirtualMethodInterceptor())
                .SetDefaultInterceptorFor <SuperJobService>(
                    new VirtualMethodInterceptor());


                ValidatorRegistrator.Register(Container);

                ControllerBuilder.Current.
                SetControllerFactory(typeof(UnityControllerFactory));
            }
        }
Beispiel #2
0
        protected virtual void InitializeContainer()
        {
            if (Container == null)
            {
                Container = new UnityContainer();
                UnityRegistrator.RegisterControls(Container,
                                                  typeof(HomeController).Assembly);
                UnityRegistrator.RegisterServices(Container);
                Container
                .RegisterType <IRepository <SiteObjectType>, SiteObjectTypeRepository>()
                .RegisterType <IRepository <PaymentType>, PaymentTypeRepository>()
                .RegisterType <IRepository <NewsType>, InMemoryRepository <NewsType> >()
                .RegisterType <IRepository <OrderCustomerType>, InMemoryRepository <OrderCustomerType> >()
                .RegisterType <IRepository <TestStatus>, NamedIdRepository <TestStatus> >()
                .RegisterType <IRepository <ResponseRating>, InMemoryRepository <ResponseRating> >()
                .RegisterType <IRepository <MarketingActionType>, InMemoryRepository <MarketingActionType> >()
                .RegisterType <IRepository <RawQuestionnaireType>,
                               InMemoryRepository <RawQuestionnaireType> >()
                .RegisterType <IRepository <CenterVacancyType>,
                               InMemoryRepository <CenterVacancyType> >()
                .RegisterType <IRepository <Order>, OrderService>()
                .RegisterType <IRepository <OrderDetail>, OrderDetailService>()
                .RegisterInstance(typeof(IMetaDataProvider), MetaDataProvider)
                .RegisterType <IContextProvider, ContextProvider>()
                .RegisterType <IResponseLogicService, ResponseLogicService>();

                Container.Configure <Interception>()
                .SetDefaultInterceptorFor <PaymentTypeRepository>(
                    new VirtualMethodInterceptor());


                ControllerBuilder.Current.
                SetControllerFactory(typeof(CmsControllerFactory));
                ControllerBuilder.Current.DefaultNamespaces.Add(Const.Common.ControllerNamespace);
            }
        }