ASP.NET Core
12 posts tagged “ASP.NET Core”.
September 2026
-
Pass your CancellationToken all the way down
When a caller gives up on a request, your code should stop working on it too. It only takes a parameter, but you have to pass it through every layer.
August 2026
-
Where does validation belong?
Request validation, business rules and data constraints are different kinds of checks. Putting each one in the right layer avoids both duplication and gaps.
July 2026
-
Replace legacy systems one route at a time
Big-bang rewrites of legacy apps tend to run late and launch with surprises. The strangler fig pattern moves functionality to the new system piece by piece, with a working system at every step.
-
Ship code dark with feature flags
Feature flags separate deploying code from releasing it. With Azure App Configuration, you can turn a feature on for 10% of users, or off in an emergency, without a deployment.
May 2026
-
Integration tests against a real database
The EF Core in-memory provider doesn't behave like SQL Server, so tests pass and production fails. WebApplicationFactory plus Testcontainers lets you test the real thing.
-
Add idempotency keys to your POST endpoints
When a client times out and retries a POST, did the first one work? An idempotency key lets your API recognize the retry and return the original result instead of doing the work twice.
April 2026
-
Organize code by feature, not by layer
Controllers, Services, Repositories: a layered folder structure spreads one feature across five places. Vertical slices keep everything for a feature together.
March 2026
-
Health checks that tell the truth
A health endpoint that always returns 200 doesn't help anyone. Separate "is the process alive" from "can it do its job", and let App Service act on the answer.
February 2026
-
Stop using async void and fire-and-forget
async voidcan crash your process, and_ = Task.Run(...)in a web request quietly loses errors and uses disposed services. Here's what to do instead.
January 2026
-
Receiving webhooks safely
A webhook endpoint is a public URL that anyone can call. Verify the signature, reject replays, respond quickly and expect duplicates.
November 2025
-
IOptions, IOptionsSnapshot or IOptionsMonitor?
The options pattern has three interfaces that look almost identical. Picking the wrong one means settings that never reload, or a startup crash.
-
DI lifetimes and the captive dependency trap
A singleton that holds on to a scoped service keeps it alive forever. It's one of the easiest bugs to create in ASP.NET Core and one of the hardest to spot.