Table of Contents

Class EventSeeding

Namespace
Cratis.Chronicle.Seeding
Assembly
Cratis.Chronicle.dll

Represents an implementation of IEventSeeding.

public class EventSeeding : IEventSeeding, IEventSeedingBuilder
Inheritance
EventSeeding
Implements
Inherited Members

Remarks

Initializes a new instance of the EventSeeding class.

Constructors

EventSeeding(EventStoreName, IChronicleConnection, IEventTypes, IEventSerializer, IClientArtifactsProvider, IServiceProvider, IClientArtifactsActivator, ILogger<EventSeeding>)

Represents an implementation of IEventSeeding.

public EventSeeding(EventStoreName eventStoreName, IChronicleConnection connection, IEventTypes eventTypes, IEventSerializer eventSerializer, IClientArtifactsProvider clientArtifactsProvider, IServiceProvider serviceProvider, IClientArtifactsActivator artifactActivator, ILogger<EventSeeding> logger)

Parameters

eventStoreName EventStoreName

The event store name.

connection IChronicleConnection

The Chronicle connection.

eventTypes IEventTypes

The event types.

eventSerializer IEventSerializer

The event serializer.

clientArtifactsProvider IClientArtifactsProvider

The client artifacts provider.

serviceProvider IServiceProvider

The service provider.

artifactActivator IClientArtifactsActivator

The artifact activator.

logger ILogger<EventSeeding>

The logger.

Remarks

Initializes a new instance of the EventSeeding class.

Methods

Discover()

Discovers all registered event seeders.

public Task Discover()

Returns

Task

Awaitable task.

ForEventSource(EventSourceId, IEnumerable<object>)

Seed events for a specific event source id with multiple event types. By default, seed data applies to all namespaces globally.

public IEventSeedingBuilder ForEventSource(EventSourceId eventSourceId, IEnumerable<object> events)

Parameters

eventSourceId EventSourceId

The event source id to seed for.

events IEnumerable<object>

Collection of events to seed.

Returns

IEventSeedingBuilder

The builder for continuation.

ForNamespace(EventStoreNamespaceName)

Configure seed data to be specific to a namespace.

public IEventSeedingScopeBuilder ForNamespace(EventStoreNamespaceName @namespace)

Parameters

namespace EventStoreNamespaceName

The namespace to seed for.

Returns

IEventSeedingScopeBuilder

A scoped builder for namespace-specific seed data.

For<TEvent>(EventSourceId, IEnumerable<TEvent>)

Seed events for a specific event type and event source id. By default, seed data applies to all namespaces globally.

public IEventSeedingBuilder For<TEvent>(EventSourceId eventSourceId, IEnumerable<TEvent> events) where TEvent : class

Parameters

eventSourceId EventSourceId

The event source id to seed for.

events IEnumerable<TEvent>

Collection of events to seed.

Returns

IEventSeedingBuilder

The builder for continuation.

Type Parameters

TEvent

Type of event to seed.

Register()

Registers all discovered event seeders by invoking them and sending seed data to the server.

public Task Register()

Returns

Task

Awaitable task.