C# Class Ncqrs.Eventing.Storage.SQL.MsSqlServerEventStore

Stores events for a SQL database.
Inheritance: IEventStore, ISnapshotStore
Afficher le fichier Open project: SzymonPobiega/ncqrs Class Usage Examples

Méthodes publiques

Méthode Description
GetAllEvents ( System.Guid id ) : IEnumerable

Get all event for a specific event provider.

GetAllEventsSinceVersion ( System.Guid id, long version ) : IEnumerable

Get all events provided by an specified event source.

GetAllIdsForType ( Type eventProviderType ) : IEnumerable
GetSnapshot ( System.Guid eventSourceId ) : ISnapshot

Gets a snapshot of a particular event source, if one exists. Otherwise, returns null.

GetTableCreationQueries ( ) : IEnumerable

Gets the table creation queries that can be used to create the tables that are needed for a database that is used as an event store.

This returns the content of the TableCreationScript.sql that is embedded as resource.

MsSqlServerEventStore ( String connectionString ) : System
MsSqlServerEventStore ( String connectionString, IPropertyBagConverter converter = null ) : System
RemoveUnusedProviders ( ) : void
Save ( IEventSource eventSource ) : void

Saves all events from an event provider.

SaveShapshot ( ISnapshot snapshot ) : void

Saves a snapshot of the specified event source.

Private Methods

Méthode Description
AddEventSource ( IEventSource eventSource, SqlTransaction transaction ) : void

Adds the event source to the event store.

GetVersion ( System.Guid providerId, SqlTransaction transaction ) : int?

Gets the version of the provider from the event store.

SaveEvent ( ISourcedEvent evnt, SqlTransaction transaction ) : void

Saves the event to the data store.

SaveEvents ( IEnumerable evnts, SqlTransaction transaction ) : void

Saves the events to the event store.

ToBinary ( object obj ) : byte[]
UpdateEventSourceVersion ( IEventSource eventSource, SqlTransaction transaction ) : void

Method Details

GetAllEvents() public méthode

Get all event for a specific event provider.
public GetAllEvents ( System.Guid id ) : IEnumerable
id System.Guid The id of the event provider.
Résultat IEnumerable

GetAllEventsSinceVersion() public méthode

Get all events provided by an specified event source.
public GetAllEventsSinceVersion ( System.Guid id, long version ) : IEnumerable
id System.Guid
version long
Résultat IEnumerable

GetAllIdsForType() public méthode

public GetAllIdsForType ( Type eventProviderType ) : IEnumerable
eventProviderType System.Type
Résultat IEnumerable

GetSnapshot() public méthode

Gets a snapshot of a particular event source, if one exists. Otherwise, returns null.
public GetSnapshot ( System.Guid eventSourceId ) : ISnapshot
eventSourceId System.Guid
Résultat ISnapshot

GetTableCreationQueries() public static méthode

Gets the table creation queries that can be used to create the tables that are needed for a database that is used as an event store.
This returns the content of the TableCreationScript.sql that is embedded as resource.
public static GetTableCreationQueries ( ) : IEnumerable
Résultat IEnumerable

MsSqlServerEventStore() public méthode

public MsSqlServerEventStore ( String connectionString ) : System
connectionString String
Résultat System

MsSqlServerEventStore() public méthode

public MsSqlServerEventStore ( String connectionString, IPropertyBagConverter converter = null ) : System
connectionString String
converter IPropertyBagConverter
Résultat System

RemoveUnusedProviders() public méthode

public RemoveUnusedProviders ( ) : void
Résultat void

Save() public méthode

Saves all events from an event provider.
public Save ( IEventSource eventSource ) : void
eventSource IEventSource
Résultat void

SaveShapshot() public méthode

Saves a snapshot of the specified event source.
public SaveShapshot ( ISnapshot snapshot ) : void
snapshot ISnapshot
Résultat void