KamiSama.Repositories.Json 10.0.13

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

KamiSama.Repositories.Json

Back to package index

Version: 10.0.0

Description

Lazy-loading JSON file repository with synchronous and asynchronous query and mutation APIs. It caches entities in memory and rewrites an existing JSON array file after each mutation, with important failure, atomicity, and concurrency limitations.

How to use

dotnet add package KamiSama.Repositories.Json --version 10.0.0

Point JsonRepository<TEntity> at an existing file containing a JSON array, subscribe to failure events, and prefer asynchronous reads:

using KamiSama.Repositories.Json;

using var repository = new JsonRepository<User>("data/users.json", UserIdComparer.Instance);
repository.LoadFailed += (_, error) => logger.LogError(error, "Could not load users");
repository.SaveFailed += (_, error) => logger.LogError(error, "Could not save users");

User? user = await repository.FindAsync(x => x.Id == userId, cancellationToken);

The repository loads lazily and cannot initialize a missing or invalid file. Mutations rewrite the complete JSON array non-atomically; Update only rewrites objects already changed in memory. Save failures are suppressed after raising SaveFailed, do not roll back the cache, and can leave partial file content. Locking is per instance, queries are live, and separate instances or processes can overwrite each other. Duplicate behavior follows the configured HashSet<TEntity> comparer.

Namespaces

Types

  • KamiSama.Repositories.Json.JsonRepository<TEntity> - Lazily reads an existing JSON array into a HashSet<TEntity> and rewrites the complete file after mutations. Writes are non-atomic, update only persists prior in-memory changes, failures are event-reported and suppressed, and locking does not coordinate live queries or other instances.
Product 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. 
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
11.0.0.2 78 11/23/2026
11.0.0.1 86 11/21/2026
10.0.14 95 11/8/2026
10.0.13.1 114 10/22/2026
10.0.13 107 10/22/2026
10.0.11.9 157 8/24/2026
10.0.11.8 131 8/22/2026
10.0.11.7 136 8/21/2026
10.0.11.6 136 8/19/2026
10.0.11.5 135 8/18/2026
10.0.11.4 133 8/18/2026
10.0.11.3 131 8/18/2026
10.0.11.2 145 8/18/2026
10.0.11.1 144 8/15/2026
10.0.11 137 8/11/2026
10.0.10.2 156 8/4/2026
10.0.10.1 151 7/31/2026
10.0.10 146 7/30/2026
10.0.9 154 6/20/2026
10.0.7 150 5/1/2026
Loading failed