Rask.Api.Client 0.20.1-alpha.0.228

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

Rask.Api.Client

Call your own API controllers and minimal API endpoints from C# with no URL at the call site.

// Server/PostsController.cs — ordinary ASP.NET, nothing Rask-specific
[ApiController, Route("api/posts")]
public sealed class PostsController(AppDb db) : ControllerBase
{
    [HttpGet("{id:int}")]
    public async Task<ActionResult<Post>> Get(int id) => ...;
}

// Any component. PostsClient is generated from the declaration above.
public sealed class PostDetail(PostsClient posts) : Component
{
    protected override async Task OnMountAsync() => _post = await posts.Get(Id);
}
services.AddRaskApiClient();   // registers every generated client

The endpoint you already wrote is the source of truth. A source generator reads its routes, verbs, parameters and response types, and emits one client class per controller — so the URL, the verb, the request shape and the response shape are never restated. Rename a route on the server and the call site stops compiling, instead of 404ing in production.

Minimal APIs are read from the MapGet/MapPost invocations themselves and grouped by route (/api/widgetsWidgetsClient); .WithName("…") names a method. TypedResultsOk<T>, Results<Ok<T>, NotFound>, NoContent — carries the response type.

Reflection-free JSON throughout, so it publishes clean under the WASM/AOT trimmer. In a one-project --wasm app the client crosses into the browser bundle automatically, even though the controller under Server/ is never compiled there.

Failures

ApiException.StatusCode is null when the request never reached a server — DNS, TLS, a dropped connection, a timeout — with the cause in InnerException. A status means the server answered and said no. Blurring the two makes "is it down, or am I wrong?" unanswerable:

catch (ApiException ex) when (ex.StatusCode is null) { /* offline: queue it */ }
catch (ApiException ex) when (ex.StatusCode == 404)  { /* gone: show empty  */ }

Pairs with Rask.Api, which hosts the endpoints. Documentation: https://rask.sh

Product 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. 
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 Rask.Api.Client:

Package Downloads
Rask

The one reference a Rask application needs, server or browser. On net10.0 it brings the ASP.NET host plus every battery — database, mediator, background jobs, transactional email, cache, outbox, operator dashboard, durable logs, Web Push, and SQLite snapshots and continuous backup — with RaskApp.Create(args) as the entry point. On net10.0-browser it brings the WebAssembly host, the source-generated mediator, the query cache and remote dispatch. Everything referenced is wired and on; app.Configure(c => c.Jobs.Off()) is how an app does without one. Reference Rask.Server for a lean host with no database.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.20.1-alpha.0.228 35 9/4/2026
0.20.1-alpha.0.227 32 9/4/2026
0.20.1-alpha.0.226 38 9/4/2026
0.20.1-alpha.0.225 37 9/4/2026
0.20.1-alpha.0.224 35 9/4/2026
0.20.1-alpha.0.223 43 9/4/2026
0.20.1-alpha.0.221 42 9/4/2026
0.20.1-alpha.0.220 40 9/4/2026
0.20.1-alpha.0.217 42 9/4/2026
0.20.1-alpha.0.216 38 9/4/2026
0.20.1-alpha.0.215 44 9/3/2026
0.20.1-alpha.0.213 36 9/3/2026
0.20.1-alpha.0.212 37 9/3/2026