DotNetQuery.Blazor
1.0.0-beta.2
See the version list below for details.
dotnet add package DotNetQuery.Blazor --version 1.0.0-beta.2
NuGet\Install-Package DotNetQuery.Blazor -Version 1.0.0-beta.2
<PackageReference Include="DotNetQuery.Blazor" Version="1.0.0-beta.2" />
<PackageVersion Include="DotNetQuery.Blazor" Version="1.0.0-beta.2" />
<PackageReference Include="DotNetQuery.Blazor" />
paket add DotNetQuery.Blazor --version 1.0.0-beta.2
#r "nuget: DotNetQuery.Blazor, 1.0.0-beta.2"
#:package DotNetQuery.Blazor@1.0.0-beta.2
#addin nuget:?package=DotNetQuery.Blazor&version=1.0.0-beta.2&prerelease
#tool nuget:?package=DotNetQuery.Blazor&version=1.0.0-beta.2&prerelease
DotNet Query
A TanStack Query-inspired async data fetching and state management library for .NET and Blazor.
DotNet Query brings the battle-tested data-fetching patterns of TanStack Query to the .NET ecosystem. It gives you predictable loading, error, and success states out of the box — powered by Rx.NET observables, so everything is composable, lazy, and reactive by default.
Features
- Queries — fetch async data with automatic caching, background refetching, and stale-while-revalidate semantics
- Mutations — execute data-modifying operations with lifecycle callbacks and automatic cache invalidation on success
- Reactive state — built on Rx.NET, every query and mutation exposes
IObservablestreams for composable async pipelines - Smart caching — configurable stale time and cache time control when data is re-fetched and when it is evicted
- Query deduplication — identical keys share a single cached query instance; no redundant requests
- Retry logic — exponential backoff out of the box; plug in your own strategy via
IRetryHandler - Blazor components —
<Suspense>and<Transition>components for declarative query rendering - CSR / SSR support —
QueryExecutionModecontrols Singleton (WebAssembly) vs Scoped (Server-Side Rendering) DI lifetime - DI integration — first-class support for
Microsoft.Extensions.DependencyInjection
Installation
# Core library — always required
dotnet add package DotNetQuery.Core
# DI integration
dotnet add package DotNetQuery.Extensions.DependencyInjection
# Blazor components
dotnet add package DotNetQuery.Blazor
Quick Start
// Program.cs
builder.Services.AddDotNetQuery(options =>
{
options.StaleTime = TimeSpan.FromMinutes(1);
});
// Create a query
var query = queryClient.CreateQuery(new QueryOptions<int, UserDto>
{
KeyFactory = id => QueryKey.From("users", id),
Fetcher = (id, ct) => userService.GetByIdAsync(id, ct),
});
query.Args.OnNext(42);
query.Success.Subscribe(user => Console.WriteLine($"Hello, {user.Name}!"));
query.Failure.Subscribe(error => Console.WriteLine($"Oops: {error.Message}"));
// Create a mutation
var mutation = queryClient.CreateMutation(new MutationOptions<CreateUserRequest, UserDto>
{
Mutator = (req, ct) => userService.CreateAsync(req, ct),
InvalidateKeys = [QueryKey.From("users")],
OnSuccess = (_, user) => Console.WriteLine($"Created {user.Name}"),
});
mutation.Execute(new CreateUserRequest { Name = "Alice" });
<Suspense Query="_userQuery">
<Content Context="user"><p>Hello, @user.Name!</p></Content>
<Loading><p>Loading...</p></Loading>
<Failure Context="error"><p>Error: @error.Message</p></Failure>
</Suspense>
Documentation
Full guides, examples, and API reference are available at https://psachmann.github.io/dotnet-query/.
- Introduction — core concepts and motivation
- Getting Started — install and write your first query
- Guides — queries, mutations, caching, Blazor, retries, and SSR
- API Reference — full generated API docs
Contributing
Contributions are welcome! Please see the Contributing guide for setup instructions, coding conventions, and the PR workflow. For bugs and feature requests, open an issue.
License
MIT — Copyright (c) 2026 Patrick Sachmann
| 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
- DotNetQuery.Core (>= 1.0.0-beta.2)
- Microsoft.AspNetCore.Components.Web (>= 10.0.5)
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 |
|---|---|---|
| 1.2.0 | 89 | 5/27/2026 |
| 1.1.0 | 95 | 5/21/2026 |
| 1.0.0 | 88 | 5/20/2026 |
| 1.0.0-beta.10 | 50 | 5/19/2026 |
| 1.0.0-beta.9 | 64 | 4/14/2026 |
| 1.0.0-beta.8 | 63 | 4/11/2026 |
| 1.0.0-beta.7 | 56 | 4/11/2026 |
| 1.0.0-beta.6 | 53 | 4/11/2026 |
| 1.0.0-beta.5 | 50 | 4/11/2026 |
| 1.0.0-beta.4 | 51 | 4/11/2026 |
| 1.0.0-beta.3 | 75 | 4/10/2026 |
| 1.0.0-beta.2 | 56 | 4/10/2026 |
| 1.0.0-beta.0 | 57 | 4/10/2026 |
| 0.0.0-alpha.0.11 | 103 | 3/28/2026 |
| 0.0.0-alpha.0.10 | 100 | 3/28/2026 |