Sora.Data.Cqrs 0.2.16

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

Sora Framework

Sora is a modern, modular .NET framework for building applications with clarity and flexibility—heavily inspired by Zen’s best ideas, with simpler contracts and better DX.

  • .NET 9 first. Minimal magic, clear composition.
  • Modular data adapters (JSON for dev, SQLite via Dapper), web bootstrap, and pragmatic “escape hatches.”
  • Always-on discovery (with a production warning); explicit config always wins.

See docs/ for design/ADRs. Start with docs/00-index.md and docs/08-engineering-guardrails.md.

Layering defaults: logging defaults live in Core, and secure headers in Web (see docs/decisions/0011-logging-and-headers-layering.md).

New to Sora? Read the step-by-step docs/11-getting-started.md.

Features

  • Data abstractions: IDataRepository<TEntity, TKey>, IBatchSet, capability flags.
  • Built-in adapters: JSON (dev), SQLite (Dapper) with schema sync and optional string queries.
  • Repo pipeline conveniences: identity assignment for string/Guid keys, batch helpers.
  • Instruction API: execute provider-specific instructions safely (e.g., raw SQL nonquery/scalar).
  • Web module: minimal auto-wiring for controllers/static files and health.
  • Discovery & precedence: modules self-register; production logs a warning; explicit config overrides discovery.
  • Provider priority: ProviderPriorityAttribute selects default adapter when more than one is present.

Requirements

  • .NET 9 SDK
  • Optional: Docker/WSL2 for containerized samples

Quickstart

Build and run the S0 console sample (JSON adapter):

dotnet build
dotnet run --project .\samples\S0.ConsoleJsonRepo\S0.ConsoleJsonRepo.csproj

Run the S1 web sample (SQLite optional):

dotnet run --project .\samples\S1.Web\S1.Web.csproj
  • SQLite adapter self-registers via discovery. To set a connection string explicitly:
// in Program.cs (S1.Web)
// builder.Services.AddSqliteAdapter(o => o.ConnectionString = "Data Source=.\\data\\s1.sqlite");

Using data APIs

Terse static facade for common string-key entities:

// Upsert and fetch
var todo = await new Todo { Title = "buy milk" }.Save();
var item = await Todo.Get(todo.Id);

// Batch
var result = await Todo.Batch()
	.Add(new Todo { Title = "task 1" })
	.Update(todo.Id, t => t.Title = "buy more" )
	.Save();

SQLite optional string queries (safe parameterization via Dapper):

var items = await Sora.Data.Core.Data<Todo, string>.Query("Title LIKE '%milk%'"); // WHERE suffix
// or full SELECT if preferred
var items2 = await Sora.Data.Core.Data<Todo, string>.Query("SELECT Id, Title FROM Todo WHERE Title LIKE '%milk%'");

Instruction escape hatch (SQL): see docs/10-execute-instructions.md.

More walkthroughs: docs/11-getting-started.md.

Tests

dotnet test -c Release -v minimal

CI runs on push via .github/workflows/ci.yml.

Contributing

We welcome issues and PRs. Start with docs/support/03-adapter-checklist.md and docs/08-engineering-guardrails.md.

DCO sign-off: include a Signed-off-by line in each commit. Example:

Signed-off-by: Your Name your.email@example.com

See the DCO file for the certificate text.

License

  • Code: Apache License 2.0 — see LICENSE and NOTICE.
  • Documentation: Creative Commons Attribution 4.0 — see docs/LICENSE-DOCS.md.

Trademarks: see TRADEMARKS.md for simple usage guidelines.

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 (1)

Showing the top 1 NuGet packages that depend on Sora.Data.Cqrs:

Package Downloads
Sora.Data.Cqrs.Outbox.Mongo

Outbox implementation for Sora CQRS using MongoDB.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.0 70 9/5/2025
0.2.20 71 8/22/2025
0.2.18 127 8/20/2025
0.2.17 126 8/19/2025
0.2.16 124 8/18/2025