elsa-core/src/modules/Elsa.MassTransit.AzureServiceBus/Services/MessageTopologyProvider.cs
2024-02-16 14:00:28 +01:00

27 lines
832 B
C#

using Elsa.MassTransit.AzureServiceBus.Models;
namespace Elsa.MassTransit.AzureServiceBus.Services;
/// <summary>
/// Provides message topology information.
/// </summary>
public class MessageTopologyProvider
{
private readonly IEnumerable<MessageSubscriptionTopology> _subscriptionTopology;
/// <summary>
/// Provides message topology information.
/// </summary>
public MessageTopologyProvider(IEnumerable<MessageSubscriptionTopology> subscriptionTopology)
{
_subscriptionTopology = subscriptionTopology;
}
/// <summary>
/// Retrieves all the temporary message subscriptions from the subscription topology.
/// </summary>
public IEnumerable<MessageSubscriptionTopology> GetTemporarySubscriptions()
{
return _subscriptionTopology.Where(x => x.IsTemporary);
}
}