public static void RegisterIoc(this IIocManager iocManager) { iocManager.RegisterAssemblyByConvention(typeof(OrderWebModule).GetAssembly()); iocManager.RegisterIfNot <IOrderAppService, OrderAppService>(DependencyLifeStyle.Transient); iocManager.RegisterIfNot <IApplicationInjector, ApplicationInjector>(DependencyLifeStyle.Transient); iocManager.RegisterIfNot <IBasketAppService, BasketAppService>(DependencyLifeStyle.Transient); }
public IntegratedTestBase() { LocalIocManager = new IocManager(); LocalIocManager.IocContainer.Install(new FinderInstaller()); LocalIocManager.AddConventionalRegistrar(new BasicConventionalRegistrar()); LocalIocManager.RegisterAssemblyByConvention(typeof(IRepository).Assembly); LocalIocManager.RegisterAssemblyByConvention(typeof(DomainServiceBase).Assembly); LocalIocManager.RegisterAssemblyByConvention(typeof(AppServiceBase).Assembly); LocalIocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); LocalIocManager.RegisterAssemblyByConvention(Assembly.Load("DDD.Domain.Common")); LocalIocManager.RegisterAssemblyByConvention(Assembly.Load("DDD.Domain.Core")); LocalIocManager.RegisterAssemblyByConvention(Assembly.Load("DDD.Domain.Service")); LocalIocManager.IocContainer.Register( Component.For(typeof(IDbContextProvider <>)) .ImplementedBy(typeof(UnitOfWorkDbContextProvider <>)) .LifestyleTransient(), Component.For <IUnitOfWorkDefaultOptions, UnitOfWorkDefaultOptions>().ImplementedBy <UnitOfWorkDefaultOptions>().LifestyleSingleton(), Component.For <IIocResolver, IocManager>().ImplementedBy <IocManager>().LifestyleSingleton() ); //UnitOfWorkRegistrar.Initialize(LocalIocManager); InitalAutoMapper(); }
public static void InitalizeIocRegistrations(IIocManager ioc) { var thisAssembly = typeof(ResponsibleSystemApplicationModule).GetAssembly(); ioc.RegisterAssemblyByConvention(thisAssembly); ioc.Register <ISessionService, SessionService>(); ioc.Register <HttpClient, HttpClient>(DependencyLifeStyle.Transient); ioc.Register <ICryptoService, CryptoService>(); // TODO: sprawdzić czy nie jest zbędne }
public static void RegisterIoc(this IIocManager iocManager) { iocManager.RegisterAssemblyByConvention(typeof(ItemsWebModule).GetAssembly()); iocManager.RegisterIfNot <IBrandAppService, BrandAppService>(DependencyLifeStyle.Transient); iocManager.RegisterIfNot <IItemAppService, ItemAppService>(DependencyLifeStyle.Transient); iocManager.RegisterIfNot <IApplicationInjector, ApplicationInjector>(DependencyLifeStyle.Transient); iocManager.RegisterIfNot <RedisContext <Brand>, RedisContext <Brand> >(DependencyLifeStyle.Transient); iocManager.RegisterIfNot <RedisContext <Item>, RedisContext <Item> >(DependencyLifeStyle.Transient); }
public TestBaseWithLocalIocManager() { LocalIocManager = new IocManager(); /* * 需要注意注册的次序! * 先注册拦截器 */ //开启uow事务 UnitOfWorkRegistrar.Initialize(LocalIocManager); LocalIocManager.IocContainer.Register( Component.For(typeof(IDbContextProvider <>)).ImplementedBy(typeof(UnitOfWorkDbContextProvider <>)).LifestyleTransient(), Component.For <IUnitOfWorkDefaultOptions, UnitOfWorkDefaultOptions>().ImplementedBy <UnitOfWorkDefaultOptions>().LifestyleSingleton(), Component.For <IIocResolver, IocManager>().ImplementedBy <IocManager>().LifestyleSingleton(), Component.For <IUnitOfWorkManager>().ImplementedBy <UnitOfWorkManager>().LifestyleSingleton() ); LocalIocManager.Register(typeof(UnitOfWorkInterceptor), DependencyLifeStyle.Singleton); //IocManager.Register<HelpController>(DependencyLifeStyle.Transient); LocalIocManager.IocContainer.Install(new FinderInstaller()); LocalIocManager.AddConventionalRegistrar(new BasicConventionalRegistrar()); LocalIocManager.RegisterAssemblyByConvention(typeof(IRepository).Assembly); LocalIocManager.RegisterAssemblyByConvention(typeof(DomainServiceBase).Assembly); LocalIocManager.RegisterAssemblyByConvention(typeof(AppServiceBase).Assembly); //LocalIocManager.RegisterAssemblyByConvention(typeof(TestBaseWithLocalIocManager).Assembly); //LocalIocManager.RegisterAssemblyByConvention(Assembly.Load("DDD.Domain.Common")); LocalIocManager.RegisterAssemblyByConvention(Assembly.Load("DDD.Domain.Core")); LocalIocManager.RegisterAssemblyByConvention(Assembly.Load("DDD.Domain.Service")); //IocManager.Register<IBlogRepository>(); //IocManager.Register<IUserRepository>(); }
public OracleTestBaseWithLocalIocManager() { LocalIocManager = new IocManager(); /* * 需要注意注册的次序! * 先注册拦截器 */ //开启uow事务 UnitOfWorkRegistrar.Initialize(LocalIocManager); LocalIocManager.IocContainer.Register( Component.For(typeof(IDbContextProvider <>)).ImplementedBy(typeof(UnitOfWorkDbContextProvider <>)).LifestyleTransient(), Component.For <IUnitOfWorkDefaultOptions, UnitOfWorkDefaultOptions>().ImplementedBy <UnitOfWorkDefaultOptions>().LifestyleSingleton(), Component.For <IIocResolver, IocManager>().ImplementedBy <IocManager>().LifestyleSingleton(), Component.For <IUnitOfWorkManager>().ImplementedBy <UnitOfWorkManager>().LifestyleSingleton() //Component.For<IAutoMapperInitializer, AutoMapperInitializer>().ImplementedBy<AutoMapperInitializer>().LifestyleSingleton() ); LocalIocManager.Register(typeof(UnitOfWorkInterceptor), DependencyLifeStyle.Singleton); //IocManager.Register<HelpController>(DependencyLifeStyle.Transient); LocalIocManager.IocContainer.Install(new FinderInstaller()); LocalIocManager.AddConventionalRegistrar(new BasicConventionalRegistrar()); LocalIocManager.RegisterAssemblyByConvention(typeof(IAutoMapperModule).Assembly); LocalIocManager.RegisterAssemblyByConvention(typeof(IInfrastructureDomainModule).Assembly); LocalIocManager.RegisterAssemblyByConvention(typeof(IDomainCoreModule).Assembly); LocalIocManager.RegisterAssemblyByConvention(typeof(IDomainServiceModule).Assembly); LocalIocManager.RegisterAssemblyByConvention(typeof(IAppServiceModule).Assembly); }
public static void RegisterAssembly(IIocManager iocManager) { iocManager.RegisterAssemblyByConvention(typeof(QksPluginDbContext).GetAssembly()); }
public void Initialize(IIocManager iocManager) { iocManager.RegisterAssemblyByConvention(Assembly.GetAssembly(typeof(UsuarioService))); }
public static void RegisterAssemblyByConventionEx(this IIocManager iocManager, Assembly assembly) { iocManager.RegisterAssemblyByConvention(assembly); }