EventPulse 0.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package EventPulse --version 0.0.1                
NuGet\Install-Package EventPulse -Version 0.0.1                
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="EventPulse" Version="0.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EventPulse --version 0.0.1                
#r "nuget: EventPulse, 0.0.1"                
#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.
// Install EventPulse as a Cake Addin
#addin nuget:?package=EventPulse&version=0.0.1

// Install EventPulse as a Cake Tool
#tool nuget:?package=EventPulse&version=0.0.1                

EventPulse

EventPulse provides a thin layer between your application and the event persistence for Event Sourcing systems. It's designed to be less intrusive as possible and avoid totally reflection, which means the real methods are used to retrieve the aggregations based in the events stored previously.

Code

The library was written since the initial commit using TDD, so code coverage is not a problem, furthermore, you can check the specs written to quickly undestand the usage and advanced features.

Persistence support

The events can be stored using the following implementations:

  • InMemoryEventPersistor: useful for testing purposes;
  • SqlServerEventPersistor: using a single append-only table on SQL Server;
  • PostgreSqlEventPersistor: planned;

Custom implementations can be easily made by implementing IEventPersistor.

Building it locally

Just clone this repo and run the following commands available the Makefile, or use them as reference to run the commands manually.

  • make startdb: start docker instances for database tests;
  • make build: build the library;
  • make test: run tests and if success, generate the coverage report;
  • make stopdb: stop docker instances;

Usage

For web apps you likely want to register the EventStore instance in your service provider, but in fact there is no harm in using multiple instances or even a simple singlton since the actions are very atomic and not state dependant.

var provider = new ListAggregatorProvider();
provider.Register(new PersonEventAggregator());
var eventStore = new EventStore(new InMemoryEventPersistor(), provider);

var person = new Person(new PersonCreatedEvent("John"));
person.UpdateName(new PersonNameUpdatedEvent("John Doe"));
await eventStore.Save(person);

var restoredPerson = await eventStore.Find<Person>(person.Id);
Assert.Equal("John Doe", restoredPerson!.Name);
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.3 163 1/12/2024
0.0.2 103 1/12/2024
0.0.1 119 1/11/2024