AxTools.Common 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AxTools.Common --version 1.0.0
                    
NuGet\Install-Package AxTools.Common -Version 1.0.0
                    
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="AxTools.Common" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AxTools.Common" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="AxTools.Common" />
                    
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 AxTools.Common --version 1.0.0
                    
#r "nuget: AxTools.Common, 1.0.0"
                    
#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 AxTools.Common@1.0.0
                    
#: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=AxTools.Common&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=AxTools.Common&version=1.0.0
                    
Install as a Cake Tool

Ax.Fw.Storage

Simple document database; based on SQLite

Why?

I just wanted to create an instance of class and write to it, read from it, list it's elements by key without thinking about "this database's BSON don't support ImmutableDictionary, meh", "that database doesn't support numeric keys, meh", "ah, I can't compare integer row with unsigned integer variable using that database, meh" and so on. Why not "key-value" storage? I also wanted to filter my objects by last changed datetime. That's it. My database is not fast as more "strongly-typed" databases (I think it's 1.1 - 1.5x slower in some scenarios), but it is reliable as any SQLite database.

Usage example:

// getting lifetime
var lifetime = new Lifetime();

// getting db filepath
var dbFile = GetDbPath();

try
{
	// create database or open existing; you can omit lifetime parameter, but you should call `Dispose` in this case
	var storage = new SqliteDocumentStorage(dbFile, lifetime);
	
	// create document; pair 'namespace - key' is unique; any json serializable data can be stored
	var doc = await storage.WriteDocumentAsync(_namespace: "default", _key: "test-key", _data: "test-data-0", lifetime.Token);

	// retrieve data
	var readDoc = await storage.ReadDocumentAsync(_namespace: "default", _key: "test-key", lifetime.Token);

	Assert.Equal("test-data-0", readDoc?.Data.ToObject<string>());

	// there are also 'simple' documents; 
	// namespace of simple documents is automatically determined by data type or by `SimpleDocumentAttribute`
	var simpleDoc = await storage.WriteSimpleDocumentAsync(_entryId: 123, _data: "test_data", lifetime.Token);

	var readSimpleDoc = await storage.ReadSimpleDocumentAsync<string>(_entryId: 123, lifetime.Token);

	Assert.Equal("test_data", readSimpleDoc?.Data);

	// you also can attach in-memory cache to document storage
	// cache makes read operations significantly faster
	var cachedStorage = storage.ToCached(_maxValuesCached: 1000, _cacheTtl: TimeSpan.FromSeconds(60));
}
finally
{
	await lifetime.CompleteAsync();
	new FileInfo(dbFile).TryDelete();
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
15.4.742 178 8/10/2025
15.3.741 179 7/7/2025
15.3.740 111 7/5/2025
15.3.737 279 3/3/2025
15.2.736 174 1/28/2025
15.2.735 149 1/16/2025
15.2.734 166 1/16/2025
15.2.733 138 1/15/2025
15.2.732 127 1/14/2025
15.1.731 171 11/28/2024
15.1.730 171 10/30/2024
15.1.729 171 10/29/2024
15.0.727 170 9/22/2024
15.0.726 207 9/13/2024
15.0.725 218 8/23/2024
14.8.725 198 8/23/2024
14.8.719 206 8/7/2024
14.8.717 172 8/6/2024
14.8.716 128 8/5/2024
14.8.715 167 8/5/2024
14.7.710 174 5/10/2024
14.6.709 199 3/31/2024
14.5.706 196 2/1/2024
14.5.705 214 1/18/2024
14.5.704 178 1/11/2024
14.5.703 244 12/11/2023
14.5.702 230 12/9/2023
14.5.701 196 12/8/2023
14.5.700 198 11/19/2023
14.5.699 168 11/19/2023
14.5.698 177 11/18/2023
14.5.697 150 11/17/2023
14.4.696 213 10/4/2023
14.4.2 185 9/26/2023
14.4.1 218 9/14/2023
14.4.0 196 9/11/2023
14.3.1 262 8/21/2023
14.3.0 239 7/18/2023
14.2.3 252 6/4/2023
14.2.2 244 5/31/2023
14.2.1 269 5/17/2023
14.2.0 236 5/17/2023
14.1.0 262 4/15/2023
14.0.13 334 3/3/2023
14.0.12 351 2/25/2023
14.0.11 350 2/10/2023
1.0.0 453 2/9/2023