Ejemplo n.º 1
0
        public CompositeContainerContext(IContainerConfiguration configuration, IClassWrapperCreator classWrapperCreator, IContainerSelector containerSelector)
        {
            Configuration       = configuration;
            ClassWrapperCreator = classWrapperCreator;
            typesHelper         = new TypesHelper();

            var funcHelper = new FuncHelper();

            FuncBuilder = new FuncBuilder();
            var classCreator        = new ClassCreator(funcHelper);
            var constructorSelector = new ConstructorSelector();

            CreationContext = new CreationContext(classCreator, constructorSelector, classWrapperCreator);

            var implementationTypesCollection = new ImplementationTypesCollection(configuration.GetTypesToScan(), typesHelper);

            ImplementationCache              = new ImplementationCache();
            abstractionsCollection           = new AbstractionsCollection(implementationTypesCollection, ImplementationCache);
            ImplementationConfigurationCache = new ImplementationConfigurationCache();
            var factory = new AutoAbstractionConfigurationFactory(typesHelper, abstractionsCollection, ImplementationConfigurationCache);

            compositeCollection = new CompositeCollection(new[] { new AbstractionConfigurationCollection(factory) }, containerSelector);
            compositeCollection.Add(typeof(IContainer), new StupidAbstractionConfiguration(new ContainerImplementationConfiguration()));
        }
Ejemplo n.º 2
0
 public static void ResetFactory()
 {
     ImplementationCache.Clear();
     DefaultServiceContainerFactory       = new WcfServiceContainerFactory();
     DefaultPooledServiceContainerFactory = new WcfServiceContainerFactory();
 }
 public override void SetUp()
 {
     base.SetUp();
     implementationCache = new ImplementationCache();
 }