/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit/Middleware/PayloadFilter.cs
33 строки
762 B
Chris Patterson
Refactored job service for container-based configuration and eliminated the need for service instance configuration. Added extensions for Cosmos, Redis, MongoDB, Azure Table, EF Core
15 июл 2023, 19:21
15 июл 2023, 19:21
dd63fcf
Код
Авторство
О чём код?
namespace MassTransit.Middleware { using System.Diagnostics; using System.Threading.Tasks; public class PayloadFilter<TContext, TPayload> : IFilter<TContext> where TContext : class, PipeContext where TPayload : class { readonly TPayload _payload; public PayloadFilter(TPayload payload) { _payload = payload; } public void Probe(ProbeContext context) { context.CreateFilterScope("inline"); } [DebuggerNonUserCode] [DebuggerStepThrough] public Task Send(TContext context, IPipe<TContext> next) { context.GetOrAddPayload(() => _payload); return next.Send(context); } } }