src/Miles.MassTransit/Consumers/ScopedConsumerExtensions.cs
/// <summary>
/// Connect a consumer to the receiving endpoint constructing the consumer using <see cref="ContainerConsumerFactory{TConsumer}"/>.
/// Expected there will be a <see cref="Miles.GreenPipes.ContainerScope.ContainerScopeContext"/> before this.
/// </summary>
/// <typeparam name="TConsumer">The type of the consumer.</typeparam>
/// <param name="configurator"></param>
/// <param name="configure">Optional, configure the consumer.</param>
Connect a consumer to the receiving endpoint constructing the consumer using .
Expected there will be a  before this.
Connect a consumer to the receiving endpoint constructing the consumer using . Expected there will be a before this .
public static void ScopedConsumer<TConsumer>(this IReceiveEndpointConfigurator configurator, Action<IConsumerConfigurator<TConsumer>> configure = null)
            where TConsumer : class, IConsumer
        {
            var consumerFactory = new ContainerConsumerFactory<TConsumer>();
            configurator.Consumer(consumerFactory, configure);
        }
public static void ScopedConsumer < TConsumer > ( this IReceiveEndpointConfigurator configurator , Action < IConsumerConfigurator < TConsumer > > configure = null ) where TConsumer : class , IConsumer { var consumerFactory = new ContainerConsumerFactory < TConsumer > ( ) ; configurator . Consumer ( consumerFactory , configure ) ; }
Connect a consumer to the receiving endpoint constructing the consumer using .
Connect a consumer to the receiving endpoint constructing the consumer using .
IReceiveEndpointConfigurator
this
configure
Action<IConsumerConfigurator<TConsumer>>
Optional, configure the consumer.
Optional configure the consumer .
configurator
None
typeparam
The type of the consumer.
The type of the consumer .