Agent skill · Data & Analytics

fetch-and-send-data

Call APIs, load data into components, and handle the async lifecycle in Blazor. USE FOR fetching data from a backend, submitting data to an API, displaying loading/error states, registering HttpClient, building service abstractions for Auto/WebAssembly render modes. DO NOT USE for form validation (see collect-user-input), prerendering persistence (see support-prerendering), or project scaffolding (see create-blazor-project).

dotnetgithub.com/dotnetGitHub ↗
claude-codeMIT
Install
npx skills add dotnet/skills --skill fetch-and-send-data --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 10 KB
Bundled scripts: none
Path: plugins/dotnet-blazor/skills/fetch-and-send-data/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 4,927
Language: C#
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Fetch and Send Data ## Step 1 — Read AGENTS.md Check **Interactivity Mode** and **Scope**: | Mode | Data access | |------|-------------| | None (Static SSR) | Server-side: inject services/`DbContext`. Use `[StreamRendering]` for loading UX. | | Server | Server-side: inject services/`DbContext`. Guard prerender with `??=` + `[PersistentState]`. | | WebAssembly | Browser-side: `HttpClient` only. No direct server access. | | Auto | Both server and browser. Always go through an API. | ## Step 2 — Register HttpClient Only needed when calling external APIs from Server, or always for WebAssembly/Auto. Server components accessing their own database should inject `DbContext` or a service directly. ```csharp // Named client — requires Microsoft.Extensions.Http NuGet builder.Services.AddHttpClient("CatalogAPI", client => { client.BaseAddress = new Uri("https://api.example.com/"); }); // Typed client builder.Services.AddHttpClient<CatalogClient>(client => client.BaseAddress = new Uri("https://api.example.com/")); ``` For WebAssembly/Auto with prerendering, register in **both** server and `.Client` `Program.cs`. ## Step 3 — Fetch Data ### Simple load ```razor @page "/products" @inject Catalog

What's inside
Steps it walks through
  1. Step 1 — Read AGENTS.md
  2. Step 2 — Register HttpClient
  3. Step 3 — Fetch Data
  4. Simple load
  5. Static SSR — StreamRendering
  6. Prerendering guard
  7. Step 4 — Handle Errors
  8. Cancellation is special
  9. When to add in-component error handling
  10. Rules
  11. Step 5 — Parameter-Driven Reloading
  12. Pattern: cancel-and-reload with stale data overlay
  13. Step 6 — Send Data
  14. Step 7 — Service Abstraction for Auto or WebAssembly with Prerendering
More from skills
All skills →
About this skill
What does the fetch-and-send-data skill do?

Call APIs, load data into components, and handle the async lifecycle in Blazor. USE FOR fetching data from a backend, submitting data to an API, displaying loading/error states, registering HttpClient, building service abstractions for Auto/WebAssembly render modes. DO NOT USE for form validation (see collect-user-input), prerendering persistence (see support-prerendering), or project scaffolding (see create-blazor-project).

How do I install it?

Run `npx skills add dotnet/skills --skill fetch-and-send-data --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going