Show / Hide Table of Contents

Interface IEventSourceRepository

Represents a repository that stores events in an event store (event sourcing).

Inherited Members
System.IDisposable.Dispose()
Namespace: IRM.Domain.Persistance
Assembly: IRM.dll
Syntax
public interface IEventSourceRepository : IDisposable

Methods

GetById<TAggregate>(Guid, DateTime)

Gets an aggregate from the event store.

Declaration
TAggregate GetById<TAggregate>(Guid id, DateTime loadUntilDate)
    where TAggregate : class, IEventSourced
Parameters
System.Guid id

The unique identifier of the aggregate.

System.DateTime loadUntilDate

The date of the aggregate that should be loaded.

Returns
TAggregate

An aggregate that has been rehydrated from the events in the event store.

Type Parameters
TAggregate

The type of aggregate to create and load from the events.

GetById<TAggregate>(Guid, Int32)

Gets an aggregate from the event store.

Declaration
TAggregate GetById<TAggregate>(Guid id, int version)
    where TAggregate : class, IEventSourced
Parameters
System.Guid id

The unique identifier of the aggregate.

System.Int32 version

The version of the aggregate that should be loaded. Use System.Int32.MaxValue to load the latest version.

Returns
TAggregate

An aggregate that has been rehydrated from the events in the event store.

Type Parameters
TAggregate

The type of aggregate to create and load from the events.

Save(IEventSourced, Guid, IMetadataProvider[])

Saves all events created by an aggregate in the event store.

Declaration
void Save(IEventSourced aggregate, Guid commitId, params IMetadataProvider[] metadataProviders)
Parameters
IEventSourced aggregate

The aggregate that implements IEventSourced.

System.Guid commitId

A unique identifier for this commit (save).

IMetadataProvider[] metadataProviders

Zero, one or more IMetadataProvider used to get metadata that can be stored together with the events.

Save(IEvent, Guid, IMetadataProvider[])

Saves a single event in the event store.

Declaration
void Save(IEvent event, Guid commitId, params IMetadataProvider[] metadataProviders)
Parameters
IEvent event

The IEvent to store in the event store.

System.Guid commitId

A unique identifier for this commit (save).

IMetadataProvider[] metadataProviders

Zero, one or more IMetadataProvider used to get metadata that can be stored together with the events.

Extension Methods

ObjectExtensions.DeepClone<T>(T)
AnnotationsExtensions.IsValid(Object)
EventSourceRepositoryExtensions.GetById<TAggregate>(IEventSourceRepository, Guid)
EventSourceRepositoryExtensions.Save(IEventSourceRepository, IEventSourced)
EventSourceRepositoryExtensions.Save(IEventSourceRepository, IEventSourced, IMetadataProvider[])
EventSourceRepositoryExtensions.Save(IEventSourceRepository, IEvent)
EventSourceRepositoryExtensions.Save(IEventSourceRepository, IEvent, IMetadataProvider[])
Back to top Generated by DocFX