Soenneker.Zelos.Suite 3.0.56

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

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Zelos.Suite

The file-based JSON document database engine


What is Zelos?

Zelos is a lightweight, embedded data store for .NET applications. It leverages JSON for persistent storage while maintaining an in-memory cache for rapid data access. With asynchronous, thread-safe operations, Zelos minimizes I/O overhead by periodically saving only modified containers.


Key Benefits & Features

  • Embedded & Minimalistic: Operates without the overhead of an external database server.
  • Responsive Asynchronous I/O: Uses async operations to keep your application fast and non-blocking.
  • Robust Concurrency: Employs asynchronous locks and semaphores to manage thread safety.
  • Container Organization: Segregate your data logically using named containers.
  • Efficient Persistence: Automatically saves only when necessary to reduce disk IO.
  • Resource Management: Designed to automatically dispose resources when no longer needed, ensuring clean shutdowns.
  • Repository Pattern Integration: Streamlines CRUD operations with a familiar design pattern.

Architecture & Components

ZelosDatabase

  • Core engine managing the persistence layer.
  • Loads or creates the database file on startup.
  • Periodically saves dirty containers.
  • Manages container initialization and data consistency.

ZelosContainer & IZelosContainerUtil

  • ZelosContainer:

    • Represents an in-memory container for key/value pairs (stored as JSON).
    • Handles adding, updating, and deleting items, marking itself as “dirty” for periodic saves.
  • IZelosContainerUtil:

    • Usage: Retrieves containers by combining the database file path and container name.
    • Caching & Creation: Manages container lifecycle, ensuring each container is only loaded once.

ZelosRepository

  • Provides a higher-level abstraction using the repository pattern.
  • Exposes common CRUD operations for generic document types.
  • Uses IZelosContainerUtil internally to obtain the right container.
  • Integrates logging and configuration for detailed diagnostics.

Installation

dotnet add package Soenneker.Zelos.Suite

and then register it:

services.AddZelosSuiteAsSingleton();

Zelos User Management Example

This guide demonstrates how to build a simple user management system using Zelos. The example includes:

  • UserDocument: A data model representing a user.
  • UsersRepository: Inherits from ZelosRepository<UserDocument>.
  • UserManager: Injects the repository to perform CRUD operations.

Step 1: Define the User Document

Create a UserDocument class that represents the user data model. This class should inherit from your base Document class.

using Soenneker.Documents.Document;

public class UserDocument : Document
{
    public string Name { get; set; } = string.Empty;
    public string Email { get; set; } = string.Empty;
}

Step 2: Create the Users Repository

Create an interface (IUsersRepository) for user-specific operations. Then, implement this interface in a class UsersRepository that inherits from ZelosRepository<UserDocument>. The repository will set the database file path and container name (in this case, "users").

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Soenneker.Zelos.Repository;
using Soenneker.Zelos.Container.Util.Abstract;

public class UsersRepository : IZelosRepository<UserDocument>
{
    public UsersRepository(IConfiguration configuration, ILogger<UsersRepository> logger, 
        IZelosContainerUtil containerUtil) : base(configuration, logger, containerUtil)
    {
        // Set the database file path and container name
        DatabaseFilePath = "data/zelos.db";
        ContainerName = "users";
    }
}

Step 3: Create the User Manager

Create a UserManager class that injects UsersRepository to perform operations. In this class, add a new user, update it, and then delete it.

using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;

public class UserManager
{
    private readonly IUsersRepository _usersRepository;
    private readonly ILogger<UserManager> _logger;

    public UserManager(IUsersRepository usersRepository, ILogger<UserManager> logger)
    {
        _usersRepository = usersRepository;
        _logger = logger;
    }

    public async Task Execute(CancellationToken cancellationToken = default)
    {
        // Create a new user document.
        var user = new UserDocument
        {
            Id = Guid.NewGuid().ToString(),
            Name = "John Doe",
            Email = "john@example.com"
        };

        _logger.LogInformation("Adding user with Id: {UserId}", user.Id);
        await _usersRepository.AddItem(user, cancellationToken);

        // Update the user.
        user.Email = "john.doe@example.com";
        _logger.LogInformation("Updating user with Id: {UserId}", user.Id);
        await _usersRepository.UpdateItem(user, cancellationToken);

        // Delete the user.
        _logger.LogInformation("Deleting user with Id: {UserId}", user.Id);
        await _usersRepository.DeleteItem(user.Id, cancellationToken);
    }
}
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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
3.0.336 54 9/5/2025
3.0.335 65 9/5/2025
3.0.334 122 9/4/2025
3.0.333 120 9/3/2025
3.0.332 133 9/3/2025
3.0.331 132 9/3/2025
3.0.330 124 8/21/2025
3.0.329 120 8/20/2025
3.0.328 100 8/17/2025
3.0.327 104 8/16/2025
3.0.326 76 8/15/2025
3.0.325 107 8/15/2025
3.0.324 118 8/15/2025
3.0.323 122 8/15/2025
3.0.322 130 8/12/2025
3.0.321 129 8/12/2025
3.0.320 128 8/12/2025
3.0.319 129 8/11/2025
3.0.318 130 8/11/2025
3.0.317 123 8/11/2025
3.0.316 127 8/11/2025
3.0.315 204 8/6/2025
3.0.314 203 8/5/2025
3.0.313 213 8/5/2025
3.0.312 212 8/5/2025
3.0.311 208 8/5/2025
3.0.310 191 8/5/2025
3.0.309 192 8/5/2025
3.0.308 93 7/30/2025
3.0.307 91 7/29/2025
3.0.306 142 7/9/2025
3.0.305 139 7/9/2025
3.0.304 138 7/9/2025
3.0.303 141 7/9/2025
3.0.302 145 7/8/2025
3.0.301 139 7/8/2025
3.0.300 72 7/5/2025
3.0.299 138 7/3/2025
3.0.298 136 7/1/2025
3.0.297 94 6/29/2025
3.0.296 91 6/28/2025
3.0.295 98 6/28/2025
3.0.294 66 6/28/2025
3.0.293 65 6/28/2025
3.0.292 68 6/27/2025
3.0.291 86 6/27/2025
3.0.290 138 6/25/2025
3.0.289 140 6/25/2025
3.0.288 136 6/24/2025
3.0.287 283 6/12/2025
3.0.286 294 6/11/2025
3.0.285 282 6/11/2025
3.0.284 283 6/11/2025
3.0.283 282 6/11/2025
3.0.282 287 6/11/2025
3.0.281 142 6/3/2025
3.0.280 143 6/3/2025
3.0.279 139 6/2/2025
3.0.278 154 5/28/2025
3.0.277 145 5/28/2025
3.0.276 151 5/28/2025
3.0.275 143 5/27/2025
3.0.274 142 5/27/2025
3.0.273 140 5/27/2025
3.0.272 143 5/27/2025
3.0.271 147 5/25/2025
3.0.270 109 5/25/2025
3.0.269 83 5/23/2025
3.0.268 93 5/23/2025
3.0.267 114 5/23/2025
3.0.266 127 5/23/2025
3.0.265 124 5/23/2025
3.0.264 129 5/23/2025
3.0.263 143 5/22/2025
3.0.262 158 5/19/2025
3.0.261 148 5/18/2025
3.0.260 118 5/18/2025
3.0.259 224 5/15/2025
3.0.258 240 5/15/2025
3.0.257 232 5/14/2025
3.0.256 246 5/14/2025
3.0.255 234 5/14/2025
3.0.254 228 5/14/2025
3.0.253 230 5/13/2025
3.0.252 227 5/13/2025
3.0.251 141 5/9/2025
3.0.250 151 5/8/2025
3.0.249 143 5/8/2025
3.0.248 142 5/8/2025
3.0.247 144 5/8/2025
3.0.246 163 5/8/2025
3.0.245 146 5/7/2025
3.0.244 150 5/6/2025
3.0.243 144 5/6/2025
3.0.242 143 5/5/2025
3.0.241 154 5/5/2025
3.0.240 148 5/5/2025
3.0.239 146 5/5/2025
3.0.238 151 5/5/2025
3.0.237 146 5/5/2025
3.0.236 143 5/5/2025
3.0.235 149 5/5/2025
3.0.234 146 5/5/2025
3.0.233 139 4/27/2025
3.0.232 120 4/26/2025
3.0.231 90 4/26/2025
3.0.230 173 4/10/2025
3.0.229 178 4/9/2025
3.0.228 171 4/9/2025
3.0.227 170 4/9/2025
3.0.226 170 4/9/2025
3.0.225 160 4/9/2025
3.0.224 180 4/8/2025
3.0.223 164 4/8/2025
3.0.222 145 4/8/2025
3.0.221 171 4/8/2025
3.0.220 166 4/8/2025
3.0.219 168 4/8/2025
3.0.218 163 4/8/2025
3.0.217 150 4/8/2025
3.0.216 159 4/8/2025
3.0.215 160 4/8/2025
3.0.214 161 4/8/2025
3.0.213 158 4/8/2025
3.0.212 163 4/8/2025
3.0.211 167 4/8/2025
3.0.210 171 4/8/2025
3.0.209 168 4/7/2025
3.0.208 159 4/7/2025
3.0.207 179 4/7/2025
3.0.206 166 4/7/2025
3.0.205 171 4/7/2025
3.0.204 163 4/7/2025
3.0.203 172 4/7/2025
3.0.202 170 4/7/2025
3.0.201 167 4/7/2025
3.0.200 170 4/7/2025
3.0.199 170 4/6/2025
3.0.198 165 4/6/2025
3.0.197 143 4/6/2025
3.0.196 139 4/6/2025
3.0.195 120 4/6/2025
3.0.194 114 4/6/2025
3.0.193 114 4/5/2025
3.0.192 90 4/5/2025
3.0.191 106 4/5/2025
3.0.190 110 4/5/2025
3.0.189 93 4/5/2025
3.0.188 102 4/5/2025
3.0.187 106 4/5/2025
3.0.186 103 4/4/2025
3.0.185 127 4/4/2025
3.0.184 135 4/4/2025
3.0.183 130 4/4/2025
3.0.182 153 4/4/2025
3.0.181 152 4/4/2025
3.0.180 166 4/2/2025
3.0.179 168 4/2/2025
3.0.178 159 4/2/2025
3.0.177 157 4/2/2025
3.0.176 155 4/1/2025
3.0.175 164 4/1/2025
3.0.174 171 4/1/2025
3.0.173 154 4/1/2025
3.0.172 152 4/1/2025
3.0.171 167 4/1/2025
3.0.170 160 4/1/2025
3.0.169 153 4/1/2025
3.0.168 166 4/1/2025
3.0.167 160 3/31/2025
3.0.166 155 3/31/2025
3.0.165 163 3/31/2025
3.0.164 159 3/31/2025
3.0.163 149 3/30/2025
3.0.162 148 3/30/2025
3.0.161 157 3/30/2025
3.0.160 147 3/29/2025
3.0.159 99 3/29/2025
3.0.158 94 3/29/2025
3.0.157 97 3/29/2025
3.0.156 102 3/29/2025
3.0.155 152 3/27/2025
3.0.154 137 3/27/2025
3.0.153 132 3/27/2025
3.0.152 140 3/27/2025
3.0.151 162 3/27/2025
3.0.150 465 3/26/2025
3.0.149 474 3/26/2025
3.0.148 479 3/26/2025
3.0.147 468 3/25/2025
3.0.146 467 3/25/2025
3.0.145 473 3/25/2025
3.0.144 490 3/25/2025
3.0.143 94 3/22/2025
3.0.142 83 3/21/2025
3.0.141 89 3/21/2025
3.0.140 100 3/21/2025
3.0.139 122 3/21/2025
3.0.138 117 3/21/2025
3.0.137 138 3/21/2025
3.0.136 153 3/19/2025
3.0.135 156 3/19/2025
3.0.134 157 3/19/2025
3.0.133 147 3/19/2025
3.0.132 144 3/18/2025
3.0.131 145 3/18/2025
3.0.130 144 3/18/2025
3.0.129 150 3/18/2025
3.0.128 143 3/18/2025
3.0.127 155 3/18/2025
3.0.126 140 3/16/2025
3.0.125 137 3/16/2025
3.0.124 74 3/15/2025
3.0.123 71 3/15/2025
3.0.122 81 3/15/2025
3.0.121 71 3/15/2025
3.0.120 82 3/15/2025
3.0.119 82 3/15/2025
3.0.118 75 3/15/2025
3.0.117 71 3/15/2025
3.0.116 105 3/14/2025
3.0.115 149 3/13/2025
3.0.114 163 3/13/2025
3.0.113 163 3/12/2025
3.0.112 168 3/12/2025
3.0.111 164 3/12/2025
3.0.110 162 3/12/2025
3.0.109 167 3/12/2025
3.0.108 183 3/12/2025
3.0.107 167 3/12/2025
3.0.106 170 3/12/2025
3.0.105 166 3/12/2025
3.0.104 179 3/12/2025
3.0.103 173 3/12/2025
3.0.102 186 3/11/2025
3.0.101 175 3/11/2025
3.0.100 177 3/11/2025
3.0.99 172 3/11/2025
3.0.98 183 3/11/2025
3.0.97 169 3/11/2025
3.0.96 177 3/11/2025
3.0.95 182 3/11/2025
3.0.94 171 3/11/2025
3.0.93 216 3/7/2025
3.0.92 224 3/7/2025
3.0.91 210 3/7/2025
3.0.90 227 3/7/2025
3.0.89 225 3/7/2025
3.0.88 219 3/7/2025
3.0.87 220 3/7/2025
3.0.86 228 3/7/2025
3.0.85 226 3/7/2025
3.0.84 238 3/7/2025
3.0.83 227 3/7/2025
3.0.82 208 3/7/2025
3.0.81 264 3/3/2025
3.0.80 127 3/3/2025
3.0.79 138 3/2/2025
3.0.78 140 3/2/2025
3.0.77 120 3/2/2025
3.0.76 108 3/2/2025
3.0.75 111 3/2/2025
3.0.74 107 3/2/2025
3.0.73 99 3/2/2025
3.0.72 106 3/2/2025
3.0.71 102 3/2/2025
3.0.70 110 3/2/2025
3.0.69 103 3/2/2025
3.0.68 102 3/1/2025
3.0.67 116 3/1/2025
3.0.66 105 3/1/2025
3.0.65 105 3/1/2025
3.0.64 106 3/1/2025
3.0.63 113 3/1/2025
3.0.62 96 3/1/2025
3.0.61 118 2/26/2025
3.0.60 120 2/26/2025
3.0.59 111 2/26/2025
3.0.58 109 2/26/2025
3.0.57 104 2/25/2025
3.0.56 112 2/25/2025
3.0.55 117 2/25/2025
3.0.54 113 2/25/2025
3.0.53 111 2/25/2025
3.0.52 106 2/25/2025
3.0.51 108 2/25/2025
3.0.50 104 2/25/2025
3.0.49 100 2/25/2025
3.0.48 100 2/25/2025
3.0.47 127 2/24/2025
3.0.46 154 2/23/2025
3.0.45 100 2/23/2025
3.0.44 102 2/23/2025
3.0.43 113 2/23/2025
3.0.42 103 2/23/2025
3.0.41 108 2/23/2025
3.0.40 102 2/23/2025
3.0.39 105 2/23/2025
3.0.38 97 2/23/2025
3.0.37 104 2/23/2025
3.0.36 107 2/23/2025
3.0.35 106 2/22/2025
3.0.34 106 2/22/2025
3.0.33 131 2/22/2025
3.0.32 107 2/22/2025
3.0.31 108 2/22/2025
3.0.30 113 2/22/2025
3.0.29 124 2/22/2025
3.0.28 112 2/22/2025
3.0.27 99 2/22/2025
3.0.26 114 2/22/2025
3.0.25 106 2/22/2025
3.0.24 103 2/22/2025
3.0.23 108 2/22/2025
3.0.22 114 2/21/2025
3.0.21 115 2/21/2025
3.0.20 114 2/21/2025
3.0.19 111 2/21/2025
3.0.18 106 2/21/2025
3.0.17 114 2/20/2025
3.0.16 124 2/19/2025
3.0.15 133 2/19/2025
3.0.14 112 2/19/2025
3.0.13 114 2/19/2025
3.0.12 131 2/19/2025
3.0.11 116 2/19/2025
3.0.10 119 2/19/2025
3.0.9 109 2/19/2025
3.0.8 115 2/19/2025
3.0.7 124 2/18/2025
3.0.6 115 2/18/2025
3.0.5 111 2/18/2025
3.0.4 130 2/17/2025
3.0.3 115 2/17/2025
3.0.2 115 2/17/2025
3.0.1 111 2/17/2025