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

type Type

The observer type to inspect.

eventSources IEventSources

The 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

type Type

Type to get from.

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

type Type

Type to get from.

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

type Type

Type to get from.

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

type Type

Type to get from.

Returns

IEnumerable<string>

Collection of tag values.