dotnet-cqrs/Svrnty.CQRS.Events.Abstractions/Discovery/IEventDiscovery.cs

32 lines
986 B
C#

using System;
using System.Collections.Generic;
namespace Svrnty.CQRS.Events.Abstractions.Discovery;
/// <summary>
/// Service for discovering all registered event types in the application.
/// Similar to ICommandDiscovery and IQueryDiscovery, provides runtime access to event metadata.
/// </summary>
public interface IEventDiscovery
{
/// <summary>
/// Get all registered event types.
/// </summary>
/// <returns>Collection of event metadata.</returns>
IEnumerable<IEventMeta> GetEvents();
/// <summary>
/// Get event metadata by name.
/// </summary>
/// <param name="name">The event name.</param>
/// <returns>Event metadata, or null if not found.</returns>
IEventMeta? GetEvent(string name);
/// <summary>
/// Get event metadata by CLR type.
/// </summary>
/// <param name="eventType">The event type.</param>
/// <returns>Event metadata, or null if not found.</returns>
IEventMeta? GetEvent(Type eventType);
}