Class TagExtensions
- Namespace
- Cratis.Chronicle
- Assembly
- Cratis.Chronicle.dll
Extension methods for working with tags.
public static class TagExtensions
- Inheritance
-
TagExtensions
- Inherited Members
Methods
GetEventSourceFilter(Type, IEventSources)
Gets the event source and stream filters from a type, resolving typed filters against registered definitions.
public static (EventSourceType EventSourceType, EventStreamType EventStreamType) GetEventSourceFilter(this Type type, IEventSources eventSources)
Parameters
typeTypeThe observer type to inspect.
eventSourcesIEventSourcesThe registered event source definitions.
Returns
- (EventSourceType EventSourceType, EventStreamType EventStreamType)
The event source and event stream filters.
Exceptions
- UnknownEventSource
Thrown when the typed filter's event source is not registered.
- EventStreamDoesNotBelongToEventSource
Thrown when the typed filter's stream is not declared by its event source.
GetEventSourceType(Type)
Get the EventSourceType filter from a type, if one is specified.
public static EventSourceType GetEventSourceType(this Type type)
Parameters
Returns
- EventSourceType
The EventSourceType if an EventSourceTypeAttribute is present; otherwise Unspecified.
GetEventStreamType(Type)
Get the EventStreamType filter from a type, if one is specified.
public static EventStreamType GetEventStreamType(this Type type)
Parameters
Returns
- EventStreamType
The EventStreamType if an EventStreamTypeAttribute is present; otherwise All.
GetFilterTags(Type)
Get all filter tags from a type.
public static IEnumerable<string> GetFilterTags(this Type type)
Parameters
Returns
- IEnumerable<string>
Collection of tag values to filter events by.
Remarks
Filter tags are specified via FilterEventsByTagAttribute and control which events the observer receives, as opposed to TagAttribute and TagsAttribute which label the observer itself.
GetTags(Type)
Get all tags from a type.
public static IEnumerable<string> GetTags(this Type type)
Parameters
Returns
- IEnumerable<string>
Collection of tag values.