Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 模块注册
 /// </summary>
 /// <param name="moduleTypes"></param>
 private void RegisterModules(ICollection <Type> moduleTypes)
 {
     foreach (var moduleType in moduleTypes)
     {
         _iocManager.RegisterIfNot(moduleType);
     }
 }
 private void RegisterModules(ICollection <Type> moduleTypes)
 {
     foreach (var moduleType in moduleTypes)
     {
         _iocManager.RegisterIfNot(moduleType);//模块本身未注册的,按照单例进行注入。
     }
 }
Ejemplo n.º 5
0
 public void Initialize()
 {
     foreach (var providerType in _authorizationConfiguration.Providers)
     {
         _iocManager.RegisterIfNot(providerType, DependencyLifeStyle.Transient); //TODO: Needed?
         using (var provider = _iocManager.ResolveAsDisposable <AuthorizationProvider>(providerType))
         {
             provider.Object.SetPermissions(this);
         }
     }
     Permissions.AddAllPermissions();
 }
Ejemplo n.º 6
0
        public void TestMethod5()
        {
            _iocManager.Register <ITaskService, TaskService>(DependencyLifeStyle.Transient);
            _iocManager.RegisterIfNot <ITaskService, TaskService>(DependencyLifeStyle.Transient);
            ITaskService taskService = _iocManager.Resolve <ITaskService>();

            Assert.AreEqual("aa", taskService.SaveTask("aa"));
        }
Ejemplo n.º 7
0
 private FeatureProvider CreateProvider(Type providerType)
 {
     _iocManager.RegisterIfNot(providerType);
     return((FeatureProvider)_iocManager.Resolve(providerType));
 }
Ejemplo n.º 8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="providerType"></param>
 /// <returns></returns>
 private IDisposableDependencyObjectWrapper <FeatureProvider> CreateProvider(Type providerType)
 {
     _iocManager.RegisterIfNot(providerType); //TODO: Needed?
     return(_iocManager.ResolveAsDisposable <FeatureProvider>(providerType));
 }
 private IDisposableDependencyObjectWrapper <SettingProvider> CreateProvider(Type providerType)
 {
     _iocManager.RegisterIfNot(providerType, DependencyLifeStyle.Transient); //TODO: Needed?
     return(_iocManager.ResolveAsDisposable <SettingProvider>(providerType));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AbpPerRequestRedisCacheManager"/> class.
 /// </summary>
 public AbpPerRequestRedisCacheManager(IIocManager iocManager, ICachingConfiguration configuration)
     : base(configuration)
 {
     _iocManager = iocManager;
     _iocManager.RegisterIfNot <AbpPerRequestRedisCache>(DependencyLifeStyle.Transient);
 }
Ejemplo n.º 11
0
        public static void UseMemoryCache(this ICachingConfiguration cachingConfiguration)
        {
            IIocManager iocManager = cachingConfiguration.PlusConfiguration.IocManager;

            iocManager.RegisterIfNot <ICacheManager, PlusMemoryCacheManager>();
        }