Choose rate-limiting policies by endpoint cost

Apply different ASP.NET Core rate limits to cheap reads and expensive AI or data-processing endpoints.

July 19, 2026 · 3 min · Lukas Walter

Design queue handlers for duplicate delivery

Assume a queue message can arrive more than once and make the handler’s business effects safe to repeat.

July 19, 2026 · 3 min · Lukas Walter

Use Aspire service discovery instead of hardcoded ports

Let Aspire pass service discovery information so application code can use logical service names instead of local port numbers.

July 19, 2026 · 2 min · Lukas Walter

When an AI Request Should Become a Background Job

How to decide when a .NET AI request should stay synchronous, stream its response, or move to a durable background job with HTTP 202 and a status resource.

July 19, 2026 · 14 min · Lukas Walter

Do not page without deterministic ordering

Give paged database queries a fully unique order so rows with the same sort value cannot move unpredictably between pages.

July 18, 2026 · 2 min · Lukas Walter

Validate structured model output before using it

Treat deserialized model output as untrusted data and apply normal business validation before it drives application behavior.

July 18, 2026 · 2 min · Lukas Walter

Use PeriodicTimer for cancellable asynchronous loops

Use PeriodicTimer when a background loop needs an awaitable cadence, cooperative shutdown, and sequential executions.

July 16, 2026 · 2 min · Lukas Walter

Testing Microsoft Agent Framework Applications

How to test Microsoft Agent Framework applications with fake model clients, tool contract tests, structured output tests, routing tests, workflow tests, and eval-style regression checks.

July 15, 2026 · 21 min · Lukas Walter

Use TimeProvider instead of DateTime.UtcNow in testable code

Inject TimeProvider when business logic depends on the current time, then control that time in tests.

July 15, 2026 · 1 min · Lukas Walter

Validate required options at startup

Fail during application startup when required configuration is missing or invalid instead of waiting for the first request.

July 15, 2026 · 2 min · Lukas Walter