Rask.Query 0.24.1-alpha.0.145

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

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 QueryClient reaches the live session's cache from anywhere a component runs — Render, a property, the constructor or an event handler — with nothing to inject. IQueryClient is 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 Render from 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 a Command<T> with IsPending, Error and Status to 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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net11.0

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
0.24.1-alpha.0.1760 0 12/5/2026
0.24.1-alpha.0.1715 0 12/5/2026
0.24.1-alpha.0.1659 0 12/5/2026
0.24.1-alpha.0.1641 0 12/5/2026
0.24.1-alpha.0.1610 37 12/4/2026
0.24.1-alpha.0.1605 49 12/4/2026
0.24.1-alpha.0.1594 44 12/4/2026
0.24.1-alpha.0.1577 46 12/4/2026
0.24.1-alpha.0.1561 46 12/4/2026
0.24.1-alpha.0.1559 38 12/4/2026
0.24.1-alpha.0.1558 47 12/4/2026
0.24.1-alpha.0.1557 50 12/4/2026
0.24.1-alpha.0.1556 49 12/4/2026
0.24.1-alpha.0.1555 54 12/4/2026
0.24.1-alpha.0.1552 50 12/4/2026
0.24.1-alpha.0.1541 51 12/4/2026
0.24.1-alpha.0.1522 42 12/4/2026
0.24.1-alpha.0.1516 48 12/4/2026
0.24.1-alpha.0.145 87 11/18/2026
0.24.0 174 11/16/2026
Loading failed