Validate structured model output before using it
Treat deserialized model output as untrusted data and apply normal business validation before it drives application behavior.
Treat deserialized model output as untrusted data and apply normal business validation before it drives application behavior.
Use PeriodicTimer when a background loop needs an awaitable cadence, cooperative shutdown, and sequential executions.
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.
Inject TimeProvider when business logic depends on the current time, then control that time in tests.
Fail during application startup when required configuration is missing or invalid instead of waiting for the first request.
Use HybridCache to avoid duplicate AI model calls, with a cached summarization example and deliberate cache-key design.
Skip EF Core change tracking for queries that only read entity data, but keep tracking for load-change-save updates.
Make a retried write replay the same operation instead of creating a duplicate side effect.
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.
Prefer Task unless you have a measured allocation reason and a simple consumption contract.