Winche.Core.AspNetCore
1.0.0
See the version list below for details.
dotnet add package Winche.Core.AspNetCore --version 1.0.0
NuGet\Install-Package Winche.Core.AspNetCore -Version 1.0.0
<PackageReference Include="Winche.Core.AspNetCore" Version="1.0.0" />
<PackageVersion Include="Winche.Core.AspNetCore" Version="1.0.0" />
<PackageReference Include="Winche.Core.AspNetCore" />
paket add Winche.Core.AspNetCore --version 1.0.0
#r "nuget: Winche.Core.AspNetCore, 1.0.0"
#:package Winche.Core.AspNetCore@1.0.0
#addin nuget:?package=Winche.Core.AspNetCore&version=1.0.0
#tool nuget:?package=Winche.Core.AspNetCore&version=1.0.0
Winche.Core
What every Winche package shares: settings the console (or the CLI, or your own tools) can change while the app runs, secrets, the error every Winche API answers with, and the values documents hold.
Value types
Each type has one name, written out in full, and every place derives from it: the wire key (<name>Value), the class
in C# and Dart (<Name>Value), the type in rules (x is <name>) and the console's label.
| Name | Wire | Class | Holds |
|---|---|---|---|
null |
{"nullValue": null} |
NullValue |
nothing |
boolean |
{"booleanValue": true} |
BooleanValue |
true or false |
integer |
{"integerValue": "42"} |
IntegerValue |
a 64-bit whole number (a string on the wire, so no digits are lost) |
double |
{"doubleValue": 4.5} |
DoubleValue |
a 64-bit floating-point number |
timestamp |
{"timestampValue": "2026-11-15T10:00:00Z"} |
TimestampValue |
a moment, to the microsecond |
string |
{"stringValue": "Ann"} |
StringValue |
text |
bytes |
{"bytesValue": "AQID"} |
BytesValue |
binary data (base64) |
documentReference |
{"documentReferenceValue": "users/u1"} |
DocumentReferenceValue |
a document, by its path |
fileReference |
{"fileReferenceValue": "scans/a.png"} |
FileReferenceValue |
a file in Winche Storage, by its path |
userReference |
{"userReferenceValue": "u1"} |
UserReferenceValue |
a Winche Auth user, by uid |
geoPoint |
{"geoPointValue": {"latitude": 51.5, "longitude": -0.12}} |
GeoPointValue |
a place |
array |
{"arrayValue": {"values": [ … ]}} |
ArrayValue |
an ordered list of values |
map |
{"mapValue": {"fields": { … }}} |
MapValue |
named values |
Rules also have number (an integer or a double). A path built in a rule, such as /users/$(id) or
path('users', id), is a documentReference.
Values of different types sort in the order of the table (numbers together), the same in queries, indexes and rules.
Errors
WincheError is the body of every failed Winche request — { "error": { "code", "message", "reason"?, "details"? } }
— and WincheErrorCode the one list of codes (not-found, permission-denied, unauthenticated, …),
each with one HTTP status (WincheError.StatusOf). reason is an API's own, more precise code where callers need it
(INVALID_CREDENTIALS, invalid-query).
var error = new WincheError(WincheErrorCode.NotFound, "There's no file at a/b.");
return Results.Json(error.ToBody(), statusCode: error.HttpStatus);
Settings
The app's code gives each group of settings — an area — its starting values. A version saved in the store replaces them on every instance within seconds, keeps a complete history (who, when, why), can be restored, and can be reset to the code's values. Secrets (client secrets, storage keys, mail passwords) are kept encrypted with the project's master key and are never shown again. Everything lives in the project's own PostgreSQL database, so a self-hosted project carries its settings with it.
Each Winche package works without this one: without AddWincheConfig, its areas simply use the code's values.
builder.Services.AddWincheConfig(o =>
{
o.ConnectionString = connectionString;
o.MasterKey = builder.Configuration["Winche:MasterKey"]; // 32+ characters; needed only for secrets
});
// Packages register their areas (e.g. Winche.Auth's AddWincheTokens(t => t.UseSettings())); your own code can too:
var area = builder.Services.AddWincheSettingsArea("app.banner", "Banner", new Banner("Welcome"), b => b.Text.Length > 200 ? ["Too long."] : []);
// … later: area.Current, area.Changed += …
SettingsStore.SaveAsync(area, json, by, reason) |
checks the document against the area, saves a new version, applies it here at once |
SaveAsync(area, json, by, reason, basedOn) |
the same, made from version basedOn (0: none saved yet): refused with SettingsConflictException (its Latest) when someone saved another since, so their change isn't undone |
ResetAsync(area, …) |
back to the code's values (a version of its own, so it can be undone) |
RestoreAsync(id, …) |
an earlier version again, as a new version |
HistoryAsync(area?) |
every change, newest first |
SecretStore.SetAsync / GetAsync / InfoAsync / DeleteAsync |
encrypted secrets (AES-256-GCM, bound to their name) |
Tables: winche_settings, winche_secrets (made on start, with WincheSchema: each package's tables are made and
upgraded in numbered steps under a lock, so many servers starting at once don't race). Other instances look for changes every PollInterval
(5 seconds). A saved version the app can no longer read (its shape changed) is logged and skipped.
| Product | Versions 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. |
-
net10.0
- Winche.Core (>= 1.0.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Winche.Core.AspNetCore:
| Package | Downloads |
|---|---|
|
Winche.Database.AspNetCore
A JSON document database layer built on top of PostgreSQL. Store, query, and subscribe to JSON documents — with PostgreSQL as the storage backend via JSONB. |
|
|
Winche.Storage.AspNetCore
ASP.NET Core integration base for Winche.Storage: HTTP-context claims mapping for the Winche.Rules guard. |
|
|
Winche.Functions
JavaScript and TypeScript functions for the Winche stack, run by Deno in sandboxed workers: on document, file and user changes, on a schedule, or called by apps. Written in the console or VS Code. |
|
|
Winche.Auth.AspNetCore
Authentication for the Winche stack: users, passwords and anonymous sign-in on ASP.NET Core Identity and PostgreSQL, Winche-issued ES256 tokens with a JWKS endpoint, rotating refresh tokens, and trusted external issuers. |
|
|
Winche.Assets.AspNetCore
The /assets/v1 endpoints apps read Winche Assets from. |
GitHub repositories
This package is not used by any popular GitHub repositories.