EventStorage 0.0.0-alpha.1
See the version list below for details.
dotnet add package EventStorage --version 0.0.0-alpha.1
NuGet\Install-Package EventStorage -Version 0.0.0-alpha.1
<PackageReference Include="EventStorage" Version="0.0.0-alpha.1" />
paket add EventStorage --version 0.0.0-alpha.1
#r "nuget: EventStorage, 0.0.0-alpha.1"
// Install EventStorage as a Cake Addin #addin nuget:?package=EventStorage&version=0.0.0-alpha.1&prerelease // Install EventStorage as a Cake Tool #tool nuget:?package=EventStorage&version=0.0.0-alpha.1&prerelease
asynchandler
A lightweight event sourcing framework for .Net with event-store of choice.
Overview
asynchandler is a high-performance event sourcing framework built for .Net that allows selecting event storage of choice. Combining consistency with schema flexibility, asynchandler aims to make event sourcing simplified for everyone. Currently supports Azure Sql, Postgres and Sql Server.
Prerequisites
asynchandler 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 asynchandler up -d
Usage
Simply install AsyncHandler.EventSourcing
package.
dotnet add package AsyncHandler.EventSourcing
Use AddAsyncHandler
service collection extension.
var connectionString = builder.Configuration["postgresqlsecret"]??
throw new Exception("No connection defined");
builder.Services.AddAsyncHandler(asynchandler =>
{
asynchandler.Schema = "ah";
asynchandler.AddEventSourcing(source =>
{
source.SelectEventSource(EventSources.PostgresSql, connectionString);
});
});
Select your event source of choice from SelectEventSource
.
Make sure you have defined your connection string.
Define your aggregate
Add your aggregate with AggregateRoot
public class OrderBookingAggregate : AggregateRoot<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));
}
}
AggregateRoot 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 asynchandler a star. 💜
License
This project is licensed under the terms of the MIT license.
Product | Versions 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. |
-
net8.0
- AsyncHandler.Assembly (>= 1.1.0)
- Microsoft.Data.SqlClient (>= 5.2.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Hosting (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Npgsql (>= 8.0.4)
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.7 | 35 | 11/24/2024 |
0.0.0-beta.6 | 34 | 11/23/2024 |
0.0.0-beta.5 | 33 | 11/22/2024 |
0.0.0-beta.4 | 33 | 11/20/2024 |
0.0.0-beta.3 | 31 | 11/18/2024 |
0.0.0-beta.2 | 36 | 11/17/2024 |
0.0.0-beta.1 | 35 | 11/16/2024 |
0.0.0-beta.0 | 39 | 11/5/2024 |
0.0.0-alpha.11 | 37 | 11/4/2024 |
0.0.0-alpha.10 | 45 | 11/4/2024 |
0.0.0-alpha.9 | 38 | 11/3/2024 |
0.0.0-alpha.8 | 41 | 10/25/2024 |
0.0.0-alpha.7 | 43 | 10/16/2024 |
0.0.0-alpha.6 | 42 | 10/15/2024 |
0.0.0-alpha.5 | 42 | 10/12/2024 |
0.0.0-alpha.4 | 43 | 10/10/2024 |
0.0.0-alpha.3 | 45 | 10/9/2024 |
0.0.0-alpha.2 | 46 | 10/9/2024 |
0.0.0-alpha.1 | 44 | 10/9/2024 |
0.0.0-alpha.0 | 112 | 10/8/2024 |