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.3.741 125 7/7/2025
15.3.740 63 7/5/2025
15.3.737 225 3/3/2025
15.2.736 122 1/28/2025
15.2.735 108 1/16/2025
15.2.734 110 1/16/2025
15.2.733 98 1/15/2025
15.2.732 88 1/14/2025
15.1.731 116 11/28/2024
15.1.730 124 10/30/2024
15.1.729 131 10/29/2024
15.0.727 132 9/22/2024
15.0.726 153 9/13/2024
15.0.725 163 8/23/2024
14.8.725 157 8/23/2024
14.8.719 142 8/7/2024
14.8.717 123 8/6/2024
14.8.716 89 8/5/2024
14.8.715 113 8/5/2024
14.7.710 135 5/10/2024
14.6.709 141 3/31/2024
14.5.706 159 2/1/2024
14.5.705 159 1/18/2024
14.5.704 141 1/11/2024
14.5.703 206 12/11/2023
14.5.702 168 12/9/2023
14.5.701 132 12/8/2023
14.5.700 167 11/19/2023
14.5.699 137 11/19/2023
14.5.698 146 11/18/2023
14.5.697 130 11/17/2023
14.4.696 182 10/4/2023
14.4.2 163 9/26/2023
14.4.1 184 9/14/2023
14.4.0 160 9/11/2023
14.3.1 217 8/21/2023
14.3.0 191 7/18/2023
14.2.3 183 6/4/2023
14.2.2 189 5/31/2023
14.2.1 209 5/17/2023
14.2.0 178 5/17/2023
14.1.0 208 4/15/2023
14.0.13 276 3/3/2023
14.0.12 295 2/25/2023
14.0.11 292 2/10/2023
1.0.0 365 2/9/2023