EventStorage 0.0.0-alpha.10

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

// Install EventStorage as a Cake Tool
#tool nuget:?package=EventStorage&version=0.0.0-alpha.10&prerelease                

eventstorage

A lightweight event sourcing framework for .Net with event storage of choice.

Github follow Nuget Package Nuget Github follow In follow build Status

Overview

eventstorage is a high-performance event sourcing framework built for .Net that allows selecting event storage of choice. Combining consistency with schema flexibility, es aims to make event sourcing simplified for everyone. Currently supports Azure Sql, Postgres and Sql Server.

Prerequisites

eventstorage runs on the stable release of .Net 8 and requires the SDK installed.

https://dotnet.microsoft.com/en-us/download/dotnet/8.0

Use docker to run sqlserver or postgres databases, execute docker-compose.

docker compose --project-name eventstorage up -d

Usage

Simply install EventStorage package.

dotnet add package EventStorage --prerelease

Use AddEventStorage service collection extension.

var connectionString = builder.Configuration["postgresqlsecret"]??
    throw new Exception("No connection defined");

builder.Services.AddEventStorage(eventstorage =>
{
    eventstorage.Schema = "es";
    eventstorage.AddEventSource(source =>
    {
        source.Select(EventStore.PostgresSql, connectionString)
        .Project<OrderProjection>(ProjectionMode.Consistent);
    });
});

Select your event source of choice from Select. Make sure you have defined your connection string.

Define your aggregate

Add your aggregate with EventSource<TId>

public class OrderBooking : EventSource<long> // or Guid
{
    public OrderStatus OrderStatus { get; private set; }
    protected override void Apply(SourcedEvent e)
    {
        this.InvokeApply(e);
    }
    public void Apply(OrderPlaced e)
    {
        OrderStatus = OrderStatus.Placed;
    }
    public void PlaceOrder(PlaceOrder command)
    {
        if(OrderStatus == OrderStatus.Placed)
            return;
        RaiseEvent(new OrderPlaced(command));
    }
}

EventSource<TId> allows selecting long or Guid for sourceId, selecting long offers lightnening-fast queries.

To continue please visit our GitHub handle.

Give us a star ⭐

If you are an event sourcer and love OSS, give eventstorage a star. 💜

License

This project is licensed under the terms of MIT license.

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.

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.0-beta.13 59 12/13/2024
0.0.0-beta.12 38 12/10/2024
0.0.0-beta.11 37 12/2/2024
0.0.0-beta.10 41 12/1/2024
0.0.0-beta.9 50 11/26/2024
0.0.0-beta.8 43 11/26/2024
0.0.0-beta.7 44 11/24/2024
0.0.0-beta.6 43 11/23/2024
0.0.0-beta.5 46 11/22/2024
0.0.0-beta.4 40 11/20/2024
0.0.0-beta.3 40 11/18/2024
0.0.0-beta.2 43 11/17/2024
0.0.0-beta.1 42 11/16/2024
0.0.0-beta.0 44 11/5/2024
0.0.0-alpha.11 44 11/4/2024
0.0.0-alpha.10 50 11/4/2024
0.0.0-alpha.9 47 11/3/2024
0.0.0-alpha.8 47 10/25/2024
0.0.0-alpha.7 50 10/16/2024
0.0.0-alpha.6 49 10/15/2024
0.0.0-alpha.5 49 10/12/2024
0.0.0-alpha.4 48 10/10/2024
0.0.0-alpha.3 50 10/9/2024
0.0.0-alpha.2 51 10/9/2024
0.0.0-alpha.1 49 10/9/2024
0.0.0-alpha.0 137 10/8/2024