예제 #1
0
        public void FirstTestName()
        {
            CatalogBuilder builder = new CatalogBuilderImpl();

            var type = typeof(Subject);
            var constructor = type.GetConstructor(new[] {typeof(ISomething)});

            builder.AddRegistrationFactory(ConstructorRegistrationFactory.Create(type, constructor));

            builder.Build();
        }
        public Container Create()
        {
            CatalogBuilder catalogBuilder = new CatalogBuilderImpl();

            catalogBuilder = _catalogConfigurators.Aggregate(catalogBuilder, (x, c) => c.Configure(x));

            catalogBuilder.Build();

            ContainerBuilder builder = _containerBuilderFactory();

            builder = _configurators.Aggregate(builder, (current, configurator) => configurator.Configure(current));

            return builder.Build();
        }