private void ApplyDecoratorOnContainerUncontrolledCollection( ExpressionBuiltEventArgs e, Type?decoratorType) { var serviceType = e.RegisteredServiceType.GetGenericArguments()[0]; var uncontrolledInterceptor = new ContainerUncontrolledServicesDecoratorInterceptor( this.data, this.singletonDecoratedCollectionsCache, e, serviceType); if (uncontrolledInterceptor.SatisfiesPredicate()) { if (this.data.DecoratorTypeFactory != null) { // Context gets set by SatisfiesPredicate var context = uncontrolledInterceptor.Context !; decoratorType = this.GetDecoratorTypeFromDecoratorFactory( serviceType, context); } if (decoratorType != null) { uncontrolledInterceptor.SetDecorator(decoratorType); uncontrolledInterceptor.ApplyDecorator(); } } }
private void ApplyDecoratorOnContainerUncontrolledCollection(ExpressionBuiltEventArgs e, Type decoratorType) { var serviceType = e.RegisteredServiceType.GetGenericArguments()[0]; var uncontrolledInterceptor = new ContainerUncontrolledServicesDecoratorInterceptor(this.data, this.singletonDecoratedCollectionsCache, e, serviceType); if (uncontrolledInterceptor.SatisfiesPredicate()) { if (this.data.DecoratorTypeFactory != null) { decoratorType = this.GetDecoratorTypeFromDecoratorFactory( serviceType, uncontrolledInterceptor.Context); } if (decoratorType != null) { uncontrolledInterceptor.SetDecorator(decoratorType); uncontrolledInterceptor.ApplyDecorator(); } } }