public void UseType(Type type)
        {
            var implementation = implementationCache.GetOrCreate(type);
            var implementationConfiguration = implementationConfigurationCache.GetOrCreate(implementation);
            var abstractionConfiguration    = new StupidAbstractionConfiguration(new[] { implementationConfiguration });

            abstractionConfigurationCollection.Add(abstractionType, abstractionConfiguration);
        }
示例#2
0
        public AutoAbstractionConfiguration(Type abstractionType,
                                            IAbstractionsCollection abstractionsCollection,
                                            IImplementationConfigurationCache implementationConfigurationCache)
        {
            var abstraction = abstractionsCollection.Get(abstractionType);

            IImplementation[] implementations = abstraction.GetImplementations();
            implementationConfigurations = new IImplementationConfiguration[implementations.Length];
            for (int i = 0; i < implementations.Length; i++)
            {
                implementationConfigurations[i] = implementationConfigurationCache.GetOrCreate(implementations[i]);
            }
        }