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

Use HybridCache for expensive AI work in .NET

Use HybridCache to avoid duplicate AI model calls, with a cached summarization example and deliberate cache-key design.

July 14, 2026 · 3 min · Lukas Walter

AsNoTracking belongs on read paths

Skip EF Core change tracking for queries that only read entity data, but keep tracking for load-change-save updates.

July 12, 2026 · 2 min · Lukas Walter

Use idempotency keys for retryable writes

Make a retried write replay the same operation instead of creating a duplicate side effect.

July 12, 2026 · 3 min · Lukas Walter

Generate Useful Test Data in .NET with Bogus

How to use the Bogus library to generate realistic, repeatable, and domain-shaped test data in .NET, including faker rules, related objects, seeds, and practical boundaries.

July 11, 2026 · 11 min · Lukas Walter