Rask.Query
0.23.1-alpha.0.46
See the version list below for details.
dotnet add package Rask.Query --version 0.23.1-alpha.0.46
NuGet\Install-Package Rask.Query -Version 0.23.1-alpha.0.46
<PackageReference Include="Rask.Query" Version="0.23.1-alpha.0.46" />
<PackageVersion Include="Rask.Query" Version="0.23.1-alpha.0.46" />
<PackageReference Include="Rask.Query" />
paket add Rask.Query --version 0.23.1-alpha.0.46
#r "nuget: Rask.Query, 0.23.1-alpha.0.46"
#:package Rask.Query@0.23.1-alpha.0.46
#addin nuget:?package=Rask.Query&version=0.23.1-alpha.0.46&prerelease
#tool nuget:?package=Rask.Query&version=0.23.1-alpha.0.46&prerelease
Rask.Query
Server state for Rask components — the Rask.Cqrs dispatcher wrapped in a cache: request dedup, staleness, background refetch and invalidation. It is TanStack Query's model in C#, for Rask, a full-stack .NET web framework for teams of any size.
- Static
QueryClientreaches the live session's cache from anywhere a component runs —Render, a property, the constructor or an event handler — with nothing to inject.IQueryClientis the injectable face for code with no component (a hosted service, a test). - The message is the key. A query record such as
new GetOrders(Page)is its own cache key, so two components asking for the same page share one entry and one round trip. - Queries follow their inputs. Declared in
Renderfrom a route parameter, a query-string value or a prop, a query re-points itself when that value changes; there is nothing to call. - Commands.
QueryClient.Command<T>()hands back aCommand<T>withIsPending,ErrorandStatusto render, and a command record names what it makes out of date with[Invalidates(typeof(GetOrders))]. - Writes refresh queries by themselves. A Rask.Data save refetches every query about the types it wrote, on the screen of the session that made it — no invalidation to write.
- Scoped per live session, so one visitor is never served another's data.
- Subscriptions —
QueryClient.Subscribe: a published CQRS notification re-renders the pages watching it.
Install
dotnet add package Rask.Query
Use
// Program.cs
builder.Services.AddRaskCqrs();
builder.Services.AddRaskQuery();
[Route("/orders")]
public sealed partial class OrdersPage : Component
{
[QueryParam] public int Page { get; set; } = 1;
protected override Component? Render()
{
var orders = QueryClient.Query(new GetOrders(Page)); // ?page=2 shows page two, by itself
return orders.IsLoading
? P["Loading…"]
: Ul[orders.Data!.Select(o => Li[o.Number])];
}
}
Guide: Rask.Query · subscriptions
| 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. net11.0 is compatible. |
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Rask.Query:
| Package | Downloads |
|---|---|
|
Rask.Wasm
The Rask browser host: runs a Rask app's C# components client-side on .NET WebAssembly, with the client halves of the batteries — the mediator and query cache, remote dispatch, accounts, validation and the component kit — on by default. Ships the JS boot scripts, the page shell, and the MSBuild integration that stages them into the published bundle — and, opted in, prerenders every route to static HTML with a sitemap.xml at publish, so a static host serves real pages to visitors and crawlers. Depends on Rask, the shared core. |
|
|
Rask.Server
The ASP.NET host for Rask, a full-stack .NET web framework, with every battery: database (SQLite, PostgreSQL or SQL Server, picked by Rask:Database:Provider), mediator and query cache, accounts, background jobs, transactional email, cache, file storage, outbox, operator dashboard, durable logs, Web Push, SQLite snapshots and continuous backup. Renders Rask components with live updates over a WebSocket. RaskApp.Create(args).Run<App>() is the whole Program.cs; app.Configure(c => c.Jobs.Off()) is how an app does without one. Depends on Rask, the shared core. |
|
|
Rask.Data
A .NET data layer for Entity Framework Core apps where you declare DDD aggregates and nothing else: no DbContext class, no DbSet property, no IEntityTypeConfiguration, no registration, and no IDbContextFactory injected to read a row. `Entity<TId>` carries Id and audit timestamps, and `Aggregate<TId>` adds a Version concurrency token, domain events and opt-in soft delete (`Deletes = Deletion.Soft`); a source generator builds the EF model from every one it finds, so nothing is reflected and a trimmed publish cannot drop a table. Value objects need no marker and map as EF complex types. Reads go through a generated read face (`Product.Read.Where(...)`, `Product.Read.Search(text)`, `Product.Read.AsQueryable()`) via C# 14 static extension members, always untracked, each on its own short-lived context. The generator also writes a nullable form model, `ProductModel`, for every aggregate, with its defaults, `ToModel()` and validation attributes; the generated writes (Product.CreateAsync(model), Product.UpdateAsync(id, model), Product.DeleteAsync(id)) take it, with an optional lambda for values the form does not carry and an optional DbContext to join; anything richer is plain EF Core through an injected context. Strongly-typed ids get a generated value converter, mapping rules live in a static Configure on the type, and interceptors drive audit stamps, opt-in soft delete, multi-tenancy (`Tenancy.PerTenant`, the tenant read from the signed-in user), optimistic concurrency and after-commit domain-event publication through Rask.Cqrs. `Current.UserId` answers who is signed in from code with nothing injected. Ranked full-text search is declared with `HasFullTextSearch` and read with `Product.Read.Search(text)`, on SQLite, PostgreSQL and in the browser. A class that does not derive from Entity stays ordinary EF Core. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.23.1-alpha.0.84 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.80 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.79 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.78 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.76 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.74 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.72 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.70 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.69 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.68 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.67 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.66 | 24 | 9/24/2026 |
| 0.23.1-alpha.0.65 | 24 | 9/24/2026 |
| 0.23.1-alpha.0.64 | 24 | 9/24/2026 |
| 0.23.1-alpha.0.62 | 26 | 9/24/2026 |
| 0.23.1-alpha.0.61 | 30 | 9/24/2026 |
| 0.23.1-alpha.0.50 | 27 | 9/24/2026 |
| 0.23.1-alpha.0.46 | 41 | 9/23/2026 |
| 0.23.0 | 146 | 9/18/2026 |