Purview.EventSourcing.AzureStorage
2.0.0-prerelease.4
See the version list below for details.
dotnet add package Purview.EventSourcing.AzureStorage --version 2.0.0-prerelease.4
NuGet\Install-Package Purview.EventSourcing.AzureStorage -Version 2.0.0-prerelease.4
<PackageReference Include="Purview.EventSourcing.AzureStorage" Version="2.0.0-prerelease.4" />
<PackageVersion Include="Purview.EventSourcing.AzureStorage" Version="2.0.0-prerelease.4" />
<PackageReference Include="Purview.EventSourcing.AzureStorage" />
paket add Purview.EventSourcing.AzureStorage --version 2.0.0-prerelease.4
#r "nuget: Purview.EventSourcing.AzureStorage, 2.0.0-prerelease.4"
#:package Purview.EventSourcing.AzureStorage@2.0.0-prerelease.4
#addin nuget:?package=Purview.EventSourcing.AzureStorage&version=2.0.0-prerelease.4&prerelease
#tool nuget:?package=Purview.EventSourcing.AzureStorage&version=2.0.0-prerelease.4&prerelease
Purview EventSourcing
Purview EventSourcing is a .NET event sourcing framework for building aggregate-based applications with provider-agnostic store facades, source-generated aggregates, transaction coordination, and storage packages for SQL Server, Azure Storage, MongoDB, and Azure Cosmos DB.
Why use it
- Build aggregates on top of
AggregateBaseand load/save them throughIEventStore. - Add queryable read models with
IQueryableEventStorewhen you need filtering, paging, and list views. - Generate aggregate event types and registration code from partial methods using the source generator support included in
Purview.EventSourcing. - Coordinate multi-aggregate saves through
IEventStoreTransactionFactory. - Swap storage providers without changing your application-facing aggregate APIs.
Packages
| Package ID | Purpose | Project README |
|---|---|---|
Purview.EventSourcing |
Core abstractions, aggregate types, facades, transactions, DI extensions, and source generation support | src/src/EventSourcing/README.md |
Purview.EventSourcing.SqlServer |
Azure SQL / SQL Server event stream and queryable snapshot stores | src/src/EventSourcing.SqlServer/README.md |
Purview.EventSourcing.AzureStorage |
Azure Table / Blob event store | src/src/EventSourcing.AzureStorage/README.md |
Purview.EventSourcing.MongoDB |
MongoDB event stream and queryable snapshot stores | src/src/EventSourcing.MongoDB/README.md |
Purview.EventSourcing.CosmosDb |
Azure Cosmos DB queryable snapshot store | src/src/EventSourcing.CosmosDb/README.md |
Install the packages you need
dotnet add package Purview.EventSourcing
dotnet add package Purview.EventSourcing.SqlServer
Provider packages layer on top of the core Purview.EventSourcing package. Add only the providers required for your chosen persistence strategy.
Quick start
1. Define an aggregate
using Purview.EventSourcing.Aggregates;
[GenerateAggregate]
public partial class OrderAggregate : AggregateBase
{
public string CustomerId { get; private set; } = default!;
public decimal Total { get; private set; }
[GenerateAggregateEvent]
public partial void CreateOrder(string customerId);
[GenerateAggregateEvent]
public partial void AddLineItem(string productId, string productName, int quantity, decimal unitPrice);
}
2. Register storage
builder.Services.AddSqlServerEventStore();
builder.Services.AddSqlServerSnapshotQueryableEventStore();
{
"ConnectionStrings": {
"eventstore-sqlserver": "Server=.;Database=MyApp;Trusted_Connection=True;"
}
}
3. Load and save through the provider-agnostic facade
public sealed class OrderService(IEventStore store)
{
public async Task PlaceOrderAsync(string orderId, string customerId, CancellationToken cancellationToken)
{
var order = await store.GetAsync<OrderAggregate>(orderId, cancellationToken)
?? await store.CreateAsync<OrderAggregate>(orderId, cancellationToken: cancellationToken);
order.CreateOrder(customerId);
order.AddLineItem("SKU-1", "Demo product", 1, 19.99m);
await store.SaveAsync(order, cancellationToken);
}
}
4. Query through a snapshot-backed facade
public sealed class OrderQueries(IQueryableEventStore store)
{
public Task<long> CountActiveOrdersAsync(CancellationToken cancellationToken) =>
store.CountAsync<OrderAggregate>(o => !o.Details.IsDeleted, cancellationToken);
}
5. Coordinate multi-aggregate saves
public sealed class CheckoutService(
IEventStoreTransactionFactory transactionFactory,
IQueryableEventStore store)
{
public async Task<bool> CheckoutAsync(
OrderAggregate order,
InventoryAggregate inventory,
CancellationToken cancellationToken)
{
await using var transaction = transactionFactory.Create();
transaction.Enlist(order, store);
transaction.Enlist(inventory, store);
var result = await transaction.CommitAsync(cancellationToken);
return result.Success;
}
}
Storage provider matrix
| Provider | Package | Registration API | Notes |
|---|---|---|---|
| Core only | Purview.EventSourcing |
AddNullQueryableEventStore() |
No persistent query store |
| Azure SQL / SQL Server | Purview.EventSourcing.SqlServer |
AddSqlServerEventStore() and AddSqlServerSnapshotQueryableEventStore() |
Separate event and snapshot implementations in one package |
| Azure Table / Blob | Purview.EventSourcing.AzureStorage |
AddAzureTableEventStore() |
Table events plus Blob support for large payloads and snapshots |
| MongoDB | Purview.EventSourcing.MongoDB |
AddMongoDBEventStore() and AddMongoDBSnapshotQueryableEventStore() |
Separate event and snapshot implementations in one package |
| Azure Cosmos DB snapshots | Purview.EventSourcing.CosmosDb |
AddCosmosDbQueryableEventStore() |
Queryable snapshot store |
For SQL Server and Azure SQL schema, permissions, and event-versioning guidance, see docs/sql-server.md.
Sample application
The sample solution demonstrates how the framework is intended to be consumed:
EventSourcing.Samples.Webuses the non-genericIEventStoreandIQueryableEventStorefacades.EventSourcing.Samples.QuickStartis a console app that demonstrates related aggregates, multi-aggregate transactions, and rollback-on-failure behavior without external infrastructure.EventSourcing.Samples.AppHostwires up SQL Server, Redis, Azurite, and the web app for Aspire-driven local runs.- Sample services such as
CartCheckoutService,OrderFulfillmentService, andStockTransferServicedemonstrate multi-aggregate workflows.
Repository layout
| Path | Purpose |
|---|---|
src/src |
Packable framework packages and sample applications |
src/tests |
Unit, integration, and source generator test projects |
docs/sql-server.md |
SQL Server and Azure SQL setup guide |
Justfile |
Build, test, format, version, pack, and publish workflow definitions |
Development workflow
dotnet tool restore
dotnet restore src/Purview.EventSourcing.slnx
dotnet build src/Purview.EventSourcing.slnx --configuration Release
dotnet csharpier check src
dotnet test --project src/tests/EventSourcing.UnitTests/EventSourcing.UnitTests.csproj --configuration Release
Additional notes:
justrecipes in theJustfilewrap the same restore, build, test, pack, and version commands for local development.- Integration tests use Testcontainers; local Docker support is recommended.
package.jsonis the release version source of truth for builds and packages.dotnet packorjust packwrites packages toartifacts/packages.
Release workflow
- Update the package version with the repository release process.
- Review the generated
CHANGELOG.mdand package version changes. - Build, test, and pack the repository.
- Let the GitHub Actions CD workflow create the tag, publish the GitHub release, and push NuGet packages.
Do not create release tags manually.
Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Data.Tables (>= 12.11.0)
- Azure.Storage.Blobs (>= 12.29.0)
- FluentValidation (>= 12.1.1)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Options (>= 10.0.9)
- Microsoft.Extensions.Telemetry.Abstractions (>= 10.7.0)
- Purview.EventSourcing (>= 2.0.0-prerelease.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 |
|---|---|---|
| 2.0.0-prerelease.21 | 36 | 6/26/2026 |
| 2.0.0-prerelease.20 | 41 | 6/26/2026 |
| 2.0.0-prerelease.19 | 37 | 6/26/2026 |
| 2.0.0-prerelease.18 | 44 | 6/25/2026 |
| 2.0.0-prerelease.16 | 58 | 6/23/2026 |
| 2.0.0-prerelease.15 | 53 | 6/22/2026 |
| 2.0.0-prerelease.14 | 59 | 6/22/2026 |
| 2.0.0-prerelease.13 | 55 | 6/21/2026 |
| 2.0.0-prerelease.4 | 54 | 6/17/2026 |
| 2.0.0-prerelease.3 | 54 | 6/17/2026 |
| 2.0.0-prerelease.2 | 55 | 6/17/2026 |
| 2.0.0-prerelease.1 | 56 | 6/15/2026 |