예제 #1
0
        public static void RegisterTypes(IUnityContainer container)
        {
            HandlerFactory.RegisterHandlers(container);
            CalculationFactory.RegisterCalculations(container);
            RegisterDataEntryServices(container);

            container.RegisterType <IFactorsService>(
                new InjectionFactory(c => CreateFactorsService()));

            container.RegisterType <IAccountService, AccountService>(
                new HierarchicalLifetimeManager(),
                new InterceptionBehavior <PolicyInjectionBehavior>(),
                new Interceptor <InterfaceInterceptor>());

            container.RegisterType <ISourceDataContext, SourceDataContext>(
                new InterceptionBehavior <PolicyInjectionBehavior>(),
                new Interceptor <InterfaceInterceptor>());

            container.RegisterType <ICalculationDataContext, CalculationDataContext>(
                new HierarchicalLifetimeManager(),
                new InterceptionBehavior <PolicyInjectionBehavior>(),
                new Interceptor <InterfaceInterceptor>());

            container.RegisterType <IDataEntriesUnitOfWork, DataEntriesUnitOfWork>(
                new HierarchicalLifetimeManager(),
                new InterceptionBehavior <PolicyInjectionBehavior>(),
                new Interceptor <InterfaceInterceptor>());

            container.RegisterType <IDataSourceService, DataSourceService>(
                new InterceptionBehavior <PolicyInjectionBehavior>(),
                new Interceptor <InterfaceInterceptor>());

            container.RegisterType <DataContext, DataContext>();
            container.RegisterType <ISliceService, SliceService>();
            container.RegisterType <IEmailManager, EmailManager>();
            container.RegisterType <ICalculationFactory, CalculationFactory>();
            container.RegisterType <IHandlerFactory, HandlerFactory>();
            container.RegisterType <IStreamManager, StreamManager>();
            container.RegisterType <ITreeWalkService, TreeWalkService>();
            container.RegisterType <TreeWalkController, TreeWalkController>();
            container.RegisterType <OverviewReportController, OverviewReportController>();
        }
예제 #2
0
 private static void RegisterTypes(IUnityContainer container)
 {
     HandlerFactory.RegisterHandlers(container);
     FolderMonitorFactory.RegisterFolderMonitor(container);
     container.RegisterType <ServiceBase, FileWatcherService>(new HierarchicalLifetimeManager());
 }