/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit/Configuration/DispatchConfigurationExtensions.cs
32 строки
1 KB
Chris Patterson
Integration of all external packages into MassTransit, split out into Abstractions, Middleware, and the core MassTransit assembly.
22 янв 2022, 18:24
22 янв 2022, 18:24
b5b4f50
Код
Авторство
О чём код?
namespace MassTransit { using System; using Configuration; using Middleware; public static class DispatchConfigurationExtensions { /// <summary> /// Adds a dispatch filter to the pipe, which can be used to route traffic /// based on the type of the incoming context /// </summary> /// <typeparam name="T"></typeparam> /// <param name="configurator"></param> /// <param name="pipeContextProviderFactory"></param> /// <param name="configure"></param> public static void UseDispatch<T>(this IPipeConfigurator<T> configurator, IPipeContextConverterFactory<T> pipeContextProviderFactory, Action<IDispatchConfigurator<T>> configure = null) where T : class, PipeContext { if (configurator == null) throw new ArgumentNullException(nameof(configurator)); var specification = new DispatchPipeSpecification<T>(pipeContextProviderFactory); configure?.Invoke(specification); configurator.AddPipeSpecification(specification); } } }