Compze.Teventive.TeventStore 0.7.0-alpha

This is a prerelease version of Compze.Teventive.TeventStore.
dotnet add package Compze.Teventive.TeventStore --version 0.7.0-alpha
                    
NuGet\Install-Package Compze.Teventive.TeventStore -Version 0.7.0-alpha
                    
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="Compze.Teventive.TeventStore" Version="0.7.0-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Compze.Teventive.TeventStore" Version="0.7.0-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Compze.Teventive.TeventStore" />
                    
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 Compze.Teventive.TeventStore --version 0.7.0-alpha
                    
#r "nuget: Compze.Teventive.TeventStore, 0.7.0-alpha"
                    
#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 Compze.Teventive.TeventStore@0.7.0-alpha
                    
#: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=Compze.Teventive.TeventStore&version=0.7.0-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Compze.Teventive.TeventStore&version=0.7.0-alpha&prerelease
                    
Install as a Cake Tool

Compze.Teventive.TeventStore

The tevent store: event-sourcing persistence for Compze taggregates.

What is Compze?

Compze is a .NET framework for building expressive domains through Teventive programming and Typermedia APIs. Learn more

What's in this package?

This package provides the tevent store that powers Compze's teventive (type-routed event) programming model:

  • Tevent persistence — TeventStore for storing and retrieving taggregate tevent streams
  • Taggregate updates — through Compze.Teventive's ITaggregateStoreUpdater, one for each unit of work, which serves every taggregate store of a container; the store declares the taggregate classes it keeps
  • Tevent caching — ITeventCache for in-memory tevent stream caching
  • Query model generation — Self-generating query models that automatically stay in sync with tevent streams
  • Tevent migration — Support for tevent schema evolution and migration
  • Taggregate history validation — Built-in validation of taggregate tevent stream consistency

Teventive programming

Tevents use the .NET type system to declare their meaning:

interface IUserTevent : ITaggregateTeventWithIdentity;
interface IUserRegistered : IUserTevent, ITaggregateCreatedTevent;
interface IUserImported : IUserRegistered;

The tevent store routes and stores these tevents based on type compatibility, enabling expressive domain modeling without manual routing.

A tevent store keeps a taggregate's tevents by their identity, so their root interface declares ITaggregateTeventWithIdentity, and it keeps only the taggregate classes declared for it, where it's composed: TeventStore(connectionName, store => store.Taggregate<User>()). The tevents are published within the process only, unless their root interface also declares a delivery guarantee, such as IExactlyOnceTevent, for other processes to receive them.

Installation

dotnet add package Compze.Teventive.TeventStore
Package Description
Compze.Teventive The Teventive programming model: taggregates, tevents and tevent dispatching
Compze.Tessaging Messaging infrastructure
Compze.Tessaging.Hosting.Testing Testing support

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Compze.Teventive.TeventStore:

Package Downloads
Compze.Teventive.TeventStore.Typermedia

Typermedia API bridge for the Compze event store — exposes event store operations as Typermedia tueries and tommands.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.0-alpha 69 11/19/2026
0.6.0-alpha 69 11/14/2026
0.5.0-alpha 165 7/24/2026
0.4.0-alpha 88 7/15/2026
0.3.1-alpha 94 7/6/2026
0.3.0-alpha 102 7/4/2026

- **Changed without a signature changing, so no compiler error points at it:**
 - **It keeps only the taggregate classes declared for it,** where it's composed: `TeventStore(connectionName)` compiles as before, and a taggregate of a class not declared, as with `store => store.Taggregate<User>()`, fails at its first use, naming the stores and the classes they keep.
 - **Its taggregates are changed only in a unit of work that `ExecuteUnitOfWork` began:** getting one for update, or adding one, in a transaction that a `TransactionScope` of the caller's own began throws, an `ExecuteUnitOfWork` inside such a transaction included. A unit of work's taggregates are held for the whole transaction, not for one scope: two scopes in one transaction get the same instance of a taggregate.
 - **A publish that fails rolls the unit of work back,** even if the code that published caught the exception: an applier, a participation handler or an invariant of the taggregate that threw leaves its state untrustworthy.
 - **Its taggregates' tevents are no longer delivered to other processes unless their hierarchy says so,** such as with `IExactlyOnceTevent`. Before, every taggregate tevent was an `IExactlyOnceTevent`, so in an exactly-once endpoint it reached the other endpoints that subscribed to it. See Compze.Teventive's changelog.
 - `GetReadonlyCopyOfVersion` throws when asked for a version past the taggregate's latest. Before, a version one past the latest returned the latest.
 - **A taggregate asked for as another class the store keeps throws an `InvalidOperationException` that names its id, the class asked for and the class it is,** as the memory image state store's does: `Get`, `TryGet`, `GetForUpdate`, `TryGetForUpdate` and `GetReadonlyCopyOfVersion` alike. Before, the replay of its history threw an `InvalidCastException`, which named neither the taggregate nor either class.
- **A self-generating query model routes its tevents as a taggregate does:** its class, and each of its components' and entities' classes, declares its routing once with `DeclareAppliers` and returns it from its override of `TeventAppliers`. A component's constructor, and `CreateSelfManagingCollection`, take their parent as `SelfGeneratingQueryModel<TQueryModel, TTaggregateTevent>.IParent`, which the query model and its parts are: they're passed `this`.
- Keeps only taggregates whose tevents implement `ITaggregateTeventWithIdentity`, as `Compze.Teventive.TeventStore.Abstractions` now requires.
- **Declares the taggregate classes it keeps,** where it's composed, as above: `TeventStore(connectionName, store => store.Taggregate<User>())`. The container's `ITaggregateStoreUpdater`, `ITaggregateStoreReader` and `ITaggregateStoreBulkReader` route each declared class to it. `ITaggregateStoreBulkReader.ReferencesToAll<TTaggregate>()` gives the histories whose creation tevent is a tevent of the class, and throws when another declared class's tevents are such tevents too, since a history doesn't say which class it is the history of.
- **A deleted taggregate's history is kept:** a taggregate that publishes an `ITaggregateDeletedTevent` has that tevent appended to its history, like any other, and a history that ends with one is no taggregate: `Get`, `TryGet`, `GetForUpdate` and `ITaggregateStoreBulkReader.ReferencesToAll` treat it as absent, while `GetHistory` and `GetReadonlyCopyOfVersion` still read the whole history. Before, such a taggregate went on being served, and the updater's delete erased the history. `ITeventStore.DeleteTaggregate` still erases a history, for data that must not be kept. Its id stays used: a new taggregate added with it fails.
- **`ITeventStore` is a singleton:** it keeps no state of its own. `TeventStoreForFlexibleTesting` calls its migrations function at each use, so the migrations may change while the container lives.
- **Requires newer minor versions of other Compze packages:** Compze.DependencyInjection 0.10.0-alpha (was 0.9.0-alpha), Compze.Internals.SystemCE 0.9.0-internal (was 0.8.0-internal), Compze.Tessaging 0.10.0-alpha (was 0.9.0-alpha), Compze.Teventive 0.7.0-alpha (was 0.6.0-alpha), Compze.Teventive.TeventStore.Abstractions 0.7.0-alpha (was 0.6.0-alpha). Upgrading to this version upgrades each package listed here too, so their changelogs apply to this upgrade as well.