Table of Contents

Class EventTypes

Namespace
Cratis.Chronicle.Events
Assembly
Cratis.Chronicle.dll

Represents an implementation of IEventTypes.

public class EventTypes : IEventTypes
Inheritance
EventTypes
Implements
Inherited Members

Constructors

EventTypes(IEventStore, IJsonSchemaGenerator, IClientArtifactsProvider)

/// Initializes a new instance of EventTypes.

public EventTypes(IEventStore eventStore, IJsonSchemaGenerator jsonSchemaGenerator, IClientArtifactsProvider clientArtifacts)

Parameters

eventStore IEventStore

The IEventStore the event types belong to.

jsonSchemaGenerator IJsonSchemaGenerator

IJsonSchemaGenerator for generating JSON schemas from types.

clientArtifacts IClientArtifactsProvider

Optional IClientArtifactsProvider for the client artifacts.

Properties

AllClrTypes

Get all event types as Cratis.Chronicle.Contracts.Events.EventTypeRegistration.

public IImmutableList<Type> AllClrTypes { get; }

Property Value

IImmutableList<Type>

Methods

Discover()

Discover all event types from the entry assembly and dependencies.

public Task Discover()

Returns

Task

Awaitable task.

GetClrTypeFor(EventTypeId)

Get a Clr Type for a specific EventTypeId.

public Type GetClrTypeFor(EventTypeId eventTypeId)

Parameters

eventTypeId EventTypeId

EventTypeId to get for.

Returns

Type

The Clr Type.

GetEventTypeFor(Type)

Get a EventType for a specific Clr Type.

public EventType GetEventTypeFor(Type clrType)

Parameters

clrType Type

Clr Type to get for.

Returns

EventType

The EventType.

GetSchemaFor(EventTypeId)

Get the NJsonSchema.JsonSchema for an EventTypeId.

public JsonSchema GetSchemaFor(EventTypeId eventTypeId)

Parameters

eventTypeId EventTypeId

EventTypeId to get for.

Returns

JsonSchema

NJsonSchema.JsonSchema for the event type.

HasFor(EventTypeId)

Check if there is a registered Clr Type for a specific EventTypeId.

public bool HasFor(EventTypeId eventTypeId)

Parameters

eventTypeId EventTypeId

EventTypeId to check for.

Returns

bool

True if there is, false if not.

HasFor(Type)

Check if there is a registered EventTypeId for a specific Clr Type.

public bool HasFor(Type clrType)

Parameters

clrType Type

Clr Type to check for.

Returns

bool

True if there is, false if not.

Register()

Register all event types with the Chronicle.

public Task Register()

Returns

Task

Awaitable task.