IEnumerable <Action <IConsumeContext <TMessage> > > IConsumerFactory <TConsumer> .GetConsumer <TMessage>(IConsumeContext <TMessage> context, InstanceHandlerSelector <TConsumer, TMessage> selector) { using (ICodeSwitchContainerScope innerScope = CreateContainerScope(context)) { TConsumer consumer; if (!innerScope.TryResolve(out consumer)) { throw new ConfigurationException(string.Format("The consumer type {0} could not be resolved from the container.", typeof(TConsumer).ToShortTypeName())); } foreach (var handler in selector(consumer, context)) { yield return(handler); } } }
public ContextSagaRepository(ICodeSwitchContainerScope scope, ISagaRepository <TSaga> repository) { _scope = scope; _repository = repository; }
public ContextConsumerFactory(ICodeSwitchContainerScope scope) { _scope = scope; }