Class EventTypes
Represents an implementation of IEventTypes.
public class EventTypes : IEventTypes
- Inheritance
-
EventTypes
- Implements
- Inherited Members
Constructors
EventTypes(IEventStore, IJsonSchemaGenerator, IClientArtifactsProvider, IEventTypeMigrators, bool)
Initializes a new instance of EventTypes.
public EventTypes(IEventStore eventStore, IJsonSchemaGenerator jsonSchemaGenerator, IClientArtifactsProvider clientArtifacts, IEventTypeMigrators eventTypeMigrators, bool enableEventTypeGenerationValidation = false)
Parameters
eventStoreIEventStoreThe IEventStore the event types belong to.
jsonSchemaGeneratorIJsonSchemaGeneratorIJsonSchemaGenerator for generating JSON schemas from types.
clientArtifactsIClientArtifactsProviderOptional IClientArtifactsProvider for the client artifacts.
eventTypeMigratorsIEventTypeMigratorsIEventTypeMigrators for discovering event type migrators.
enableEventTypeGenerationValidationboolWhether to enable event type generation chain validation on the server. Defaults to false.
Properties
All
Get all EventType discovered event types.
public IImmutableList<EventType> All { get; }
Property Value
AllClrTypes
Get all event types as Cratis.Chronicle.Contracts.Events.EventTypeRegistration.
public IImmutableList<Type> AllClrTypes { get; }
Property Value
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
eventTypeIdEventTypeIdEventTypeId to get for.
Returns
GetClrTypeFor(EventTypeId, EventTypeGeneration)
Get a Clr Type for a specific EventTypeId and EventTypeGeneration.
public Type GetClrTypeFor(EventTypeId eventTypeId, EventTypeGeneration generation)
Parameters
eventTypeIdEventTypeIdEventTypeId to get for.
generationEventTypeGenerationEventTypeGeneration to get for.
Returns
GetEventTypeFor(Type)
public EventType GetEventTypeFor(Type clrType)
Parameters
Returns
GetSchemaFor(EventTypeId)
Get the Cratis.Chronicle.Schemas.JsonSchema for an EventTypeId.
public JsonSchema GetSchemaFor(EventTypeId eventTypeId)
Parameters
eventTypeIdEventTypeIdEventTypeId to get for.
Returns
- JsonSchema
Cratis.Chronicle.Schemas.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
eventTypeIdEventTypeIdEventTypeId 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
Returns
- bool
True if there is, false if not.
Register()
Register all event types with the Chronicle.
public Task Register()
Returns
- Task
Awaitable task.