Example #1
0
        // This constructor is called when we're in 'flowing' mode, because in that case we need to set the
        // scope before forwarding the call to InstanceProducers.
        protected ContainerControlledCollection(
            Container container, ContainerControlledCollection <TService> definition)
        {
            this.container = container;

            // Reference the producers from the definition. This doesn't cause any new objects.
            this.lazyProducers = definition.lazyProducers;
            this.producers     = definition.producers;
        }
        internal static InstanceProducer CreateInstanceProducer <TService>(
            this ContainerControlledCollection <TService> collection, Container container)
        {
            var collectionType = typeof(IEnumerable <TService>);

            return(new InstanceProducer(
                       serviceType: collectionType,
                       registration: collection.CreateRegistration(collectionType, container)));
        }
Example #3
0
 public FlowingContainerControlledCollection(
     Scope scope, ContainerControlledCollection <TService> definition)
     : base(scope.Container !, definition)