What is ConcurrentDictionary good for?
Simple meaning
Thread-safe dictionary operations without a coarse lock for every access.
Open the full page for Why, Steps, Example and Key takeaway.
Panel-ready .NET / C# questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.
Thread-safe dictionary operations without a coarse lock for every access.
Open the full page for Why, Steps, Example and Key takeaway.
It treats an in-memory sequence as IQueryable so expression trees can be composed.
Open the full page for Why, Steps, Example and Key takeaway.
MapControllers enables attribute-routed controller endpoints.
Open the full page for Why, Steps, Example and Key takeaway.
I return FileStreamResult or Results.File with the right content type and content-disposition.
Open the full page for Why, Steps, Example and Key takeaway.
They run set-based updates and deletes without loading entities into memory.
Open the full page for Why, Steps, Example and Key takeaway.
They eager-load related data in one query.
Open the full page for Why, Steps, Example and Key takeaway.
I add an IsDeleted flag and a global query filter.
Open the full page for Why, Steps, Example and Key takeaway.
Clients present a TLS client cert that middleware maps to a user.
Open the full page for Why, Steps, Example and Key takeaway.
I store the key ring in a shared location and let new keys activate while old ones decrypt existing cookies.
Open the full page for Why, Steps, Example and Key takeaway.
It creates stubs and verifies interactions on interfaces.
Open the full page for Why, Steps, Example and Key takeaway.
I inject an abstraction for UtcNow instead of DateTime.UtcNow directly.
Open the full page for Why, Steps, Example and Key takeaway.
Factory creates short-lived contexts for parallel or background work.
Open the full page for Why, Steps, Example and Key takeaway.
BeginScope attaches properties to subsequent log calls in that block.
Open the full page for Why, Steps, Example and Key takeaway.
The configuration stack layers providers
Open the full page for Why, Steps, Example and Key takeaway.
Formatters choose JSON or XML based on Accept headers when configured.
Open the full page for Why, Steps, Example and Key takeaway.
You need GetAwaiter returning something with IsCompleted, OnCompleted, and GetResult.
Open the full page for Why, Steps, Example and Key takeaway.
ref struct types like Span can only live on the stack so they can safely point at stack memory.
Open the full page for Why, Steps, Example and Key takeaway.
I never block on .Result or .Wait in ASP.NET request threads.
Open the full page for Why, Steps, Example and Key takeaway.
Expand then contract: add nullable columns, dual-write, backfill, switch reads, drop later.
Open the full page for Why, Steps, Example and Key takeaway.
SaveChanges and command interceptors add auditing, multi-tenant filters, or soft-delete stamps.
Open the full page for Why, Steps, Example and Key takeaway.