Skip to content
Michal Mrnuštík edited this page Apr 30, 2021 · 6 revisions

EventSourced

EventSourced is an open-source .NET library for building projects based on Domain Driven Design principles in combination with Event Sourcing pattern.

Installation

The library is hosted on NuGet repository and can be added to your project by simply referencing it. Depending on the storage option of your choosing you can use Entity Framework based package (EventSourced.Persistence.EntityFramework) or in-memory based store (EventSourced.Persistence.InMemory package). You can use both approaches in one project simply by registering both of them.

General setup

After you are done installing the package you can simply add it to your projects Startup.cs files by registering its services in ServiceCollection.

Following example setups EventSourced library with EntityFramework used for preserving events and snapshots and with in-memory based projection store:

services.AddEventSourced(options => options.AddEntityFrameworkSupport(o => o.UseSqlServer(Configuration.GetConnectionString("EventStore")))
                                           .UseEntityFrameworkEventStore()
                                           .UseInMemoryProjectionStore()
                                           .UseEntityFrameworkSnapshotStore())

Further reading

To learn more about using the Event Sourced library continue to these sections:

Clone this wiki locally