/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit.Abstractions/SendTuple.cs
31 строка
877 B
Chris Patterson
Adding nullability to abstractions, and fixing warnings
15 фев 2022, 17:36
15 фев 2022, 17:36
8a72e94
Код
Авторство
О чём код?
namespace MassTransit { /// <summary> /// Combines a message and a pipe which can be used to send/publish the message /// </summary> /// <typeparam name="T"></typeparam> public readonly struct SendTuple<T> where T : class { public readonly T Message; public readonly IPipe<SendContext<T>> Pipe; public SendTuple(T message, IPipe<SendContext<T>>? pipe) { Message = message; Pipe = pipe != null && pipe.IsNotEmpty() ? pipe : MassTransit.Pipe.Empty<SendContext<T>>(); } public SendTuple(T message) { Message = message; Pipe = MassTransit.Pipe.Empty<SendContext<T>>(); } public void Deconstruct(out T message, out IPipe<SendContext<T>> pipe) { message = Message; pipe = Pipe; } } }