Ejemplo n.º 1
0
 internal ConventionalRegistrationContext(Assembly assembly, IIocManager iocManager,
                                          ConventionalRegistrationConfig config)
 {
     Assembly   = assembly;
     IocManager = iocManager;
     Config     = config;
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     Registers types of given assembly by all conventional registrars. See <see cref="AddConventionalRegistrar" />
        ///     method.
        /// </summary>
        /// <param name="assembly">Assembly to register</param>
        /// <param name="config">Additional configuration</param>
        public void RegisterAssemblyByConvention(Assembly assembly, ConventionalRegistrationConfig config)
        {
            var context = new ConventionalRegistrationContext(assembly, this, config);

            foreach (var registerer in conventionalRegistrars)
            {
                registerer.RegisterAssembly(context);
            }

            if (config.InstallInstallers)
            {
                IocContainer.Install(FromAssembly.Instance(assembly));
            }
        }