![]() |
VOOZH | about |
dotnet add package Hexalith.EventStores --version 1.3.0
NuGet\Install-Package Hexalith.EventStores -Version 1.3.0
<PackageReference Include="Hexalith.EventStores" Version="1.3.0" />
<PackageVersion Include="Hexalith.EventStores" Version="1.3.0" />Directory.Packages.props
<PackageReference Include="Hexalith.EventStores" />Project file
paket add Hexalith.EventStores --version 1.3.0
#r "nuget: Hexalith.EventStores, 1.3.0"
#:package Hexalith.EventStores@1.3.0
#addin nuget:?package=Hexalith.EventStores&version=1.3.0Install as a Cake Addin
#tool nuget:?package=Hexalith.EventStores&version=1.3.0Install as a Cake Tool
A lightweight and efficient event store implementation for .NET applications using event sourcing patterns. This library provides a robust foundation for building event-sourced systems with support for event persistence, snapshots, and versioning.
👁 Codacy Badge
👁 Quality Gate Status
👁 Security Rating
👁 Maintainability Rating
👁 Code Smells
👁 Lines of Code
👁 Technical Debt
👁 Reliability Rating
👁 Duplicated Lines (%)
👁 Vulnerabilities
👁 Bugs
👁 Build status
👁 NuGet
👁 Latest
Hexalith.EventStores provides a flexible event storage solution for applications implementing event sourcing patterns. It offers:
dotnet add package Hexalith.EventStores
// Create event store provider
IKeyValueProvider keyValueProvider = new YourKeyValueProvider();
IEventStoreProvider provider = new KeyValueEventStoreProvider(keyValueProvider);
// Open an event store (creates if not exists)
IEventStore store = await provider.OpenStoreAsync(
"YourAggregateName",
"YourAggregateId",
cancellationToken);
try
{
// Store events using the helper extension method
var events = new List<EventMessage>
{
new YourDomainEvent { /* event data */ }.CreateMessage()
};
long version = await store.AddAsync(events, cancellationToken);
// Retrieve events
IEnumerable<EventMessage> storedEvents = await store.GetAsync(cancellationToken);
// Create a snapshot
await store.SnapshotAsync(
version,
CalculateSnapshot(storedEvents),
cancellationToken);
}
finally
{
// Close the store when done
store.Close();
}
Snapshots allow for efficient retrieval of event stream state without replaying all events:
// Create a snapshot at the current version
long version = await store.VersionAsync(cancellationToken);
await store.SnapshotAsync(
version,
CalculateSnapshot(events),
cancellationToken);
// Retrieve using snapshot
var events = await store.GetAsync(useSnapshot: true, cancellationToken);
The event store implements session-based locking to prevent concurrent access. When using OpenStoreAsync, the store is automatically opened. For custom timeout configuration:
// Open with custom timeouts (after getting the store)
await store.OpenAsync(
TimeSpan.FromMinutes(5), // session timeout
TimeSpan.FromSeconds(10), // open timeout
cancellationToken);
The repository includes examples demonstrating how to use Hexalith.EventStores in practical scenarios:
A simple application that demonstrates core event sourcing concepts using a bank account domain model:
Future releases will include examples covering:
The repository is organized as follows:
This project is licensed under the MIT License - see the file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.