IOptionsSnapshot: The Snapshot Your Singleton Froze
IOptionsSnapshot is scoped. Inject it into a singleton and Production will not throw. You get one snapshot, minted at first resolve, that ignores every reload.
Tag
Articles tagged Dotnet on The Augmented Dev.
8 articles
IOptionsSnapshot is scoped. Inject it into a singleton and Production will not throw. You get one snapshot, minted at first resolve, that ignores every reload.
Cookie auth, antiforgery, and TempData encrypt with the Data Protection key ring. The default ring is local. A second instance, a slot swap, or a recycled container mints a ring the first one never had.
ExecuteUpdate sends SQL now. It skips SaveChanges, the tracker, and your audit interceptor. Stamp columns in the SET, or the tracked entity lies.
ASP.NET Core binds CancellationToken to the aborted request. Forward it to EF Core and HttpClient, and do not turn a client disconnect into a 500.
Why new HttpClient() in a .NET service exhausts sockets under load, and how IHttpClientFactory plus a named client fixes DNS without freezing the handler forever.
A synchronous plug-in runs inside the user's transaction with a hard time limit. One slow query or external call can break saves for everyone. Here is how to keep plug-ins fast and safe.
A clear-eyed look at Command Query Responsibility Segregation — what it actually is, how to implement it in .NET, when it pays off, and when it's unnecessary complexity.
A step-by-step guide to diagnosing and resolving NuGet package source errors in Visual Studio and dotnet CLI.