Papst.EventStore 5.2.18

There is a newer version of this package available.
See the version list below for details.
dotnet add package Papst.EventStore --version 5.2.18
                    
NuGet\Install-Package Papst.EventStore -Version 5.2.18
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Papst.EventStore" Version="5.2.18" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Papst.EventStore" Version="5.2.18" />
                    
Directory.Packages.props
<PackageReference Include="Papst.EventStore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Papst.EventStore --version 5.2.18
                    
#r "nuget: Papst.EventStore, 5.2.18"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Papst.EventStore@5.2.18
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Papst.EventStore&version=5.2.18
                    
Install as a Cake Addin
#tool nuget:?package=Papst.EventStore&version=5.2.18
                    
Install as a Cake Tool

Event Store

Event Souring Library that allows storing Events into a Database. Comes with an implementation of a Azure CosmosDb EventStore.

The CosmosDb Implementation uses the following Microsoft libraries:

  • Microsoft.Azure.Cosmos
  • Microsoft.Extensions.Configuration.Abstractions
  • Microsoft.Extensions.Configuration.Binder
  • Microsoft.Extensions.Logging.Abstractions
  • Microsoft.Extensions.Options

and comes with included compatability to the dependency injection of the .NET Core (Web)HostBuilder.

A Sample can be found in the samples directory.

Available EventStore implementations

The library brings a couple of already implemented EventStore packages:

Installing the Library

Configuring the Code Generator

  • Events must be attributed with the EventName attribute.
  • EventAggregators, implementing the interface IEventAggregator or implementing the abstract class EventAggregatorBase are automatically added to the Dependency Injection.

Configuring Write and Read Event Identifier

It is possible to have multiple EventName attributes on just one event. With the attribute IsWriteName it is possible to define which Identifier is used when writing the event.

[EventName(Name = "MyEventV1", IsWriteName = false)]
[EventName(Name = "MyEventV2")]
public class MyEventsourcingEvent 
{

}

Reading Events named MyEventV1 or MyEventV2 will deserialize them into a MyEventsourcingEvent. Writing MyEventsourcingEvent to the Event Stream, will serialize them and name them MyEventV2.

Note: IsWriteName is true by default!

Configuring an Implementation for use

Please refer to the documentation in the relevant implementation sources:

Changelog

V 5.2

V5.2 introduces Metadata on the Stream itself. The IEventStream now got its own metadata Property.

Meta Data for the Stream needs to be set during creation, otherwise it will be empty. To Create a stream with Meta Data the IEventStorehas got a new extended CreateAsync method that takes the additional metadata.

Only the Azure Cosmos Implementation offers a new option in the configuration that updates the TenantId based on the last set event.

V 5 / V5.1

V5 comes with a new access model to the streams, with paging and a new library structure.

V5 Supports only .NET 8.0 and upwards

It introduces a separation of EventStore and EventStream. The EventStore now only offers the possibility to create or retrieve streams.

Breaking Changes

  • The IEventStore interface no longer has methods to append to the EventStream
  • The new IEventStream needs an index document, which needs to be added to existing event streams. See Migration Chapter in Cosmos DB Implementation.
  • The IEventStreamAggregator implementation that uses the code generated events has moved to a own package to allow removing active code from the Papst.EventStore package.
  • The EventName Attribute now uses positional parameters, provided by a constructor.
  • A single EventStream can no longer contain Events for multiple Entities.
  • The IEventStreamAggregator now uses ValueTask instead of Task

Changes

  • Meta Data Properties are now of type string? instead of Guid? to achieve greater compatability.

V 4

  • V4 only supports .NET 6.0

It introduces the concept of Code Generated registration of events and aggregators by decorating them with the EventName attribute.

It also decouples the auto generated event type descriptor (was basically a description used to revert to a type using Type.GetType()) from the concrete implementation. This allows to version and migrate events by just adding a different descriptor.

A sample on how to use the Event Descriptors is found under Samples. The Extension Method AddCodeGeneratedEvents() is automatically generated during compilation if the package Papst.EventStore.CodeGeneration is added to the Project.

Migrate v3 events by adding a EventName attribute and add the typename as a name: [Fullename of the type],[assembly name of the type]. For the MyEventSourcingEvent in the Code Generation Sample it would look like this:

SampleCodeGeneratedEvents.MyEventSourcingEvent,SampleCodeGeneratedEvents

Breaking Change

V4 removes support for authenticating with shared keys against the cosmos DB. The implementation is still there, but changed and marked as obsolete.

v3.x

V3 supports mainly .NET 5.0 and registration of events and event aggregators through reflection

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Papst.EventStore:

Package Downloads
Papst.EventStore.Aggregation.EventRegistration

Package Description

Papst.EventStore.AzureCosmos

This library contains a Azure Cosmos Database based implementation for the Package Papst.EventStore

Papst.EventStore.FileSystem

FileSystem based EventStore Implementation for testing purpose only!

Papst.EventStore.EntityFrameworkCore

This library contains a EntityFrameworkCore based implementation for the Package Papst.EventStore

Papst.EventStore.InMemory

InMemory based EventStore Implementation for testing purpose only!

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.2.32 152 6/3/2025
5.2.30 212 2/12/2025
5.2.28 140 2/9/2025
5.2.25 110 2/9/2025
5.2.23 117 2/9/2025
5.2.21 152 12/7/2024
5.2.18 743 11/12/2024
5.2.14 167 11/10/2024
5.2.12 143 11/10/2024
5.2.10 138 11/10/2024
5.2.7 1,278 9/28/2024
5.2.6 131 9/28/2024
5.1.4 420 8/26/2024
5.1.2 189 8/22/2024
5.0.12 188 8/15/2024
5.0.10 173 8/7/2024
5.0.9 176 8/7/2024
5.0.8 163 8/7/2024
5.0.6 141 8/6/2024
5.0.4 121 8/6/2024
5.0.2 597 8/4/2024