Teast.SimpleCQRS 0.0.1-preview2

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

// Install Teast.SimpleCQRS as a Cake Tool
#tool nuget:?package=Teast.SimpleCQRS&version=0.0.1-preview2&prerelease                

Teast.SimpleCQRS

This is a simple "CQRS"/EventStore implementation that can be used to simplify the boiling plates when building such solutions.

Implementation

The idea is to have Command objects that drives changes to your entity. One implementation is to create an CommandHandler class that can handle your Commands and that uses your Aggregate to generate an corresponding Event object.

Difference between Command and Event

The main different between this two objects is that a Command should be validated and can be rejected while an Event should never be validated and instead always be applied. A Command that is accepted should generate an Event and the Event is the one that should be stored in your data storage and then later on read from data storage when you re-play your entity through an Aggregate

Difference between snapshot and projection

a projection should always represent latest state of your entity while a snapshot can be from any state of your entity.

IStorage

This interface is the glue between Simple.CQRS and your data storage. When Repository needs to fetch events, snapshot, versions, etc from the data storage it will use an object that implements this interface.

Repository

This abstract class will take care of extracting changes from an existing Aggregate for saving to data storage or to create an Aggregate based of data fetched from IStorage.

Aggregate

Aggregate handles creation of events and to load events.

Event

Represents an change to your entity. All changes that you support should inherit from Event

Data

This class represents an snapshot (or projection) of your entity. It is possible to use SimpleCQRS without having an dedicated snapshot class.

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.1.0-preview1 70 10/2/2024
0.0.1 254 8/28/2024
0.0.1-preview7 140 5/28/2024
0.0.1-preview6 91 5/28/2024
0.0.1-preview5 90 5/19/2024
0.0.1-preview4 88 5/19/2024
0.0.1-preview3 101 5/16/2024
0.0.1-preview2 105 5/7/2024
0.0.1-preview1 96 5/7/2024