![]() |
VOOZH | about |
dotnet add package Hexalith.KeyValueStorages --version 2.1.2
NuGet\Install-Package Hexalith.KeyValueStorages -Version 2.1.2
<PackageReference Include="Hexalith.KeyValueStorages" Version="2.1.2" />
<PackageVersion Include="Hexalith.KeyValueStorages" Version="2.1.2" />Directory.Packages.props
<PackageReference Include="Hexalith.KeyValueStorages" />Project file
paket add Hexalith.KeyValueStorages --version 2.1.2
#r "nuget: Hexalith.KeyValueStorages, 2.1.2"
#:package Hexalith.KeyValueStorages@2.1.2
#addin nuget:?package=Hexalith.KeyValueStorages&version=2.1.2Install as a Cake Addin
#tool nuget:?package=Hexalith.KeyValueStorages&version=2.1.2Install as a Cake Tool
Hexalith Key/Value Storages is a flexible and extensible key-value storage library for .NET applications. It provides both in-memory and file-based storage implementations with support for optimistic concurrency control through Etags.
The library offers a robust foundation for implementing key-value storage solutions with the following features:
Add the NuGet package to your project:
dotnet add package Hexalith.KeyValueStorages
// Create an in-memory store
var store = new InMemoryKeyValueStore<string, MyData>();
// Add a value
long etag = await store.AddAsync("key1", new MyData(), CancellationToken.None);
// Retrieve a value
var result = await store.GetAsync("key1", CancellationToken.None);
MyData value = result.Value;
long currentEtag = result.Etag;
// Update a value
long newEtag = await store.SetAsync("key1", updatedData, currentEtag, CancellationToken.None);
// Create a JSON file store
var store = new JsonFileKeyValueStorage<string, MyData>("data-directory");
// Operations are similar to in-memory store
string etag = await store.AddAsync("key1", new MyData(), CancellationToken.None);
IKeyValueStore<TKey, TValue, TEtag>: The main interface defining key-value store operationsIKeySerializer<TKey>: Interface for key serializationIValueSerializer<TValue, TEtag>: Interface for value serialization with Etag supportIn-Memory Storage:
InMemoryKeyValueStore<TKey, TValue>: Simple in-memory implementation with long-based EtagsInMemoryKeyValueStore<TKey, TValue, TEtag>: Base class supporting custom Etag typesThe library implements optimistic concurrency control using Etags:
All implementations are thread-safe:
Create custom implementations by:
IKeyValueStore<TKey, TValue, TEtag>IKeySerializer<TKey> or IValueSerializer<TValue, TEtag>This project is licensed under the MIT License - see the file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. 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. |
Showing the top 2 NuGet packages that depend on Hexalith.KeyValueStorages:
| Package | Downloads |
|---|---|
|
Hexalith.KeyValueStorages.Files
Hexalith KeyValueStorages utilities and helpers |
|
|
Hexalith.KeyValueStorages.DaprComponents
Hexalith KeyValueStorages utilities and helpers |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.2 | 256 | 4/12/2025 |
| 2.1.1 | 244 | 4/11/2025 |
| 2.1.0 | 247 | 4/11/2025 |
| 2.0.2 | 276 | 4/10/2025 |
| 2.0.1 | 256 | 4/10/2025 |
| 2.0.0 | 275 | 4/10/2025 |
| 1.6.0 | 266 | 4/9/2025 |
| 1.5.0 | 261 | 4/8/2025 |
| 1.4.2 | 282 | 4/8/2025 |
| 1.4.1 | 264 | 4/7/2025 |
| 1.4.0 | 261 | 4/7/2025 |
| 1.3.2 | 252 | 4/6/2025 |
| 1.3.1 | 255 | 4/6/2025 |
| 1.3.0 | 268 | 4/6/2025 |
| 1.2.0 | 273 | 4/6/2025 |
| 1.1.0 | 208 | 4/4/2025 |
| 1.0.0 | 243 | 4/4/2025 |