SimpleJsonStorageOrm 1.3.1

dotnet add package SimpleJsonStorageOrm --version 1.3.1
                    
NuGet\Install-Package SimpleJsonStorageOrm -Version 1.3.1
                    
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="SimpleJsonStorageOrm" Version="1.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimpleJsonStorageOrm" Version="1.3.1" />
                    
Directory.Packages.props
<PackageReference Include="SimpleJsonStorageOrm" />
                    
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 SimpleJsonStorageOrm --version 1.3.1
                    
#r "nuget: SimpleJsonStorageOrm, 1.3.1"
                    
#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 SimpleJsonStorageOrm@1.3.1
                    
#: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=SimpleJsonStorageOrm&version=1.3.1
                    
Install as a Cake Addin
#tool nuget:?package=SimpleJsonStorageOrm&version=1.3.1
                    
Install as a Cake Tool

Simple JSON Storage

Simple JSON-powered storage interface.

Forewords

  • This project is not meant for high performance. (It runs purely on pure JSON so what could you really expect)
  • Further documentation is properly documented in source code.
  • Whilst utilizing ProgramStorage<T>, you might always want to initialize your DB first. You could achieve it through ProgramStorageSet<T>.Set(obj), where Set() is an instance method of ProgramStorageSet<>, and obj is an instance of T

Quick Start

public class Settings
{
    public bool IsOn{get;set; }
    ...
}
var storage = new ProgramStorage<Settings>(identifier: "com.org.app", name: "Settings"); 
storage.Set(i=>i.IsOn, true); 
storage.Get(i=>i.IsOn); // Will be true. 

// Seperate example
public class Person
{
    public string Name{get;set; }
}
var storage = new ProgramStorageSet<Person>(identifier: "com.org.app", name: "People"); 
storage.Add(new()
{
    Name = "Andrew"
});
storage.Add(new()
{
    Name = "Alexander"
});

// Now storage will look something like: [{Name: "Andrew"}, {Name: "Alexander"}]. 
// Please check Intellisense for more overloads. 

Details

ProgramStorages

ProgramStorage<T>

Resembles a single object. Type is controlled by generic T. IO is instantly saved. Configurable through OnConfiguring() delegate.

ProgramStorageSet<T>

Resembles a set of single object, like DbSet<T> in EF Core. Type is controlled by generic T. IO is instantly saved. Configurable through OnConfiguring() delegate.

DelayedProgramStorageSet<T>

Resembles a set of single object with advanced features like SaveChanges() and auto-saving by time period. Configurable through OnConfiguring() delegate.

OnConfiguring()

OnConfiguring([identifier], (ConfigurationBuilder o) => o..., [JSONSerializerOptions]);

Currently o has 2 extension methods for configuring: UseAutoSaveChanges() and UseCheckOnSaveChanges(). CheckOnSaveChanges works on all 3 types of storage but UseAutoSaveChanges only applies to DelayedProgramStorageSet.

Storage Pool

Storage pool is something resembles DbContext in EF Core by deriving custom "contexts" from class StoragePool.

Any number and combinations of above storage types would work.

public sealed class SampleStoragePool : StoragePool
{
    public ProgramStorageSet<string> Strings { get; set; } = null!;

    public SampleStoragePool(string identifier, JsonSerializerOptions? options = null)
    {
        OnConfiguring(identifier, options);
    }
}

Where It's Stored

The default is basically the evaluation of

Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),identifier, $"{name}.json")

Windows default: %APPDATA%/[identifier]/[name].json

In storage pools [name] is your property name. 

Mac: /Users/[username]/Library/Application Support/[identifier]/[name].json (I think so)

Don't know about Linux.

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 is compatible.  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.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.

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
1.3.1 141 3/15/2026
1.3.0 131 3/15/2026
1.2.2 142 3/12/2026
1.2.1 139 3/12/2026
1.2.0 136 3/12/2026
1.1.0 130 3/12/2026
1.0.0 138 3/12/2026

IDisposable