Exemplo n.º 1
0
        public void RegisterAssemblyByConvention(Assembly assembly, ConventionalRegistrationConfig config)
        {
            var _context = new ConventionalRegistrationContext(assembly, this, config);

            foreach (var registerer in _conventionalRegistrar)
            {
                registerer.RegisterAssembly(_context);
            }

            if (config.InstallInstallers)
            {
                IocContainer.Install(FromAssembly.Instance(assembly));
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 注册约束上下文
 /// </summary>
 /// <param name="assembly">程序集</param>
 /// <param name="iocManager">Ioc 容器</param>
 /// <param name="config">配置项</param>
 public ConventionalRegistrationContext(Assembly assembly, IIocManager iocManager, ConventionalRegistrationConfig config)
 {
     Assembly   = assembly;
     IocManager = iocManager;
     Config     = config;
 }