/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit.Abstractions/Transports/EndpointAddressExtensions.cs
29 строк
867 B
Chris Patterson
Adding nullability to abstractions, and fixing warnings
15 фев 2022, 17:36
15 фев 2022, 17:36
8a72e94
Код
Авторство
О чём код?
namespace MassTransit.Transports { using System; using System.Linq; public static class EndpointAddressExtensions { /// <summary> /// Returns the endpoint name (the last part of the URI, without the query string or preceding path) /// from the address /// </summary> /// <param name="address"></param> /// <returns></returns> public static string? GetEndpointName(this Uri? address) { return address?.AbsolutePath?.Split('/').LastOrDefault(); } public static string GetDiagnosticEndpointName(this Uri address) { var endpointName = address.GetEndpointName(); if (string.IsNullOrWhiteSpace(endpointName)) return ""; return endpointName!.Contains("_bus_") ? "bus" : endpointName; } } }