Ejemplo n.º 1
0
        private void initMap()
        {
            InterFaceFactory.Container.Register <IUnitOfWork, DapperUnitOfWork>();

            //为ApplicationRepository的构造函数的参数uow绑定指定的对象
            InterFaceFactory.Container.Register <IApplicationRepository, ApplicationRepository>();

            InterFaceFactory.Container.Register <IApplicationServer, ApplicationServer>();
            InterFaceFactory.Container.Register <IDeviceServer, DeviceServer>();

            InterFaceFactory.Container.Register <IApplicationSettings, WebConfigApplicationSettings>();

            InterFaceFactory.Container.RegisterInstance <ICommandHandleRegisterEntry, CommandHandleRegisterEntry>();
            InterFaceFactory.Container.RegisterInstance <IDomainEventHandleRegisterEntry, DomainEventHandleRegisterEntry>();
            InterFaceFactory.Container.RegisterInstance <CommandBus>();
            //InterFaceFactory.Container.RegisterInstanceWithConstructorArgument<CommandBus>("", InterFaceFactory.Container.Get<ICommandHandleRegisterEntry>()));



            ApplicationSettingsFactory.InitialzeApplicationSettingsFactory(InterFaceFactory.Container.Get <IApplicationSettings>());
        }