The core elements to enable Event Sourcing paradigms using the Sql Stream Store framework
-
Asp.Net Standard/Core Dependency Injection
- Use the provided
services.AddInMemoryEventStore(Action<EventSourcingOptions> optionsAccessor, params Assembly[] eventAssemblies)method
- Use the provided
-
Other Containers
- Register all instances required for
IEventSourceProjectionas Transient dependencies - Register an instance of
GetEventTypesas a Singleton.EventCollection.GetEventTypeshas been provided for this use case - Register an instance of
IPersistentSubscriptionManageras a Singleton.PersistentSubscriptionManagerhas been provided for this use case - Register an instance of
IEventPersistenceas a Singleton.SqlEventStorehas been provided for this use case - Register
EventSubscriptionas a hosted service
- Register all instances required for
-
Task<T> GetById<T>(Guid id, CancellationToken cancellationToken = default) where T : class, IEventSourceAggregate- An asynchronous function to call when retrieving events from a stream in the shape of an Aggregate
-
Task Save(IEventSourceAggregate aggregate, CancellationToken cancellationToken = default)- An asynchronous function to call when saving new events that have been applied to an Aggregate
-
Task<Guid> CreateCategorySubscription(string categoryName, Func<object, CancellationToken, Task> eventReceived, CancellationToken cancellationToken = default)- An asynchronous function to call when creating a subscription to a Category
-
Task CloseSubscription(Guid subscriptionId, CancellationToken cancellationToken = new CancellationToken())- An asynchronous function to call when closing a subscription
-
Task<int> CatchSubscriptionUp(string streamName, int checkpoint, Func<object, CancellationToken, Task> eventReceived, CancellationToken cancellationToken = default)- An asynchronous function to call when a stream has moved forward from a subscription, facilitates fast catch up.