AI Wisdom

Tag

csharp

33 articles tagged with “csharp

AIAI-SearchAPI-gatewayASP.NET-CoreAzure-APIMAzure-OpenAICIClaudeCoTCopilotCosmos-DBCursorDORAEvent-GridGPTGemmaGitFlowGitHubHPAICLJSONJSON-modeLLMLLM-securityMCPMistralModel-Context-ProtocolOIDCOmitPartialPhiPickPineconeQdrantRAGReActRecordSDKSLISLMSLOSemantic-KernelService-BusWindsurfa-staragentsaggregationaiai-gatewayaksalertingalgorithmsapi-designapi-gatewayapi-versioningapimapp-routerapp-serviceappsecarchitecturearm-templatesaspnet-coreaspnetcoreasyncauditauthenticationauthorizationautomationazureazure-front-doorazure-functionsazure-openaiazure-policyazure-storagebddbenchmarksbest-practicesbfsbicepbinary-searchbranchingbstcache-componentscachingcap-theoremchain-of-thoughtchatbotci-cdci-optimizationcicdclean-architecturecloudcloud-securitycloudeventscode-reviewcoding-agentscomparisoncompliancecomposeconcurrencyconcurrent-renderingconditional-typesconsistencyconsistent-hashingconstraintsconsumer-drivencontainerscontextcontract-testingcosmos-dbcost-controlcost-optimizationcoveragecqrscsharpcvecypressdapperdastdata-fetchingdatabasesdataloaderddddecision-frameworkdependency-injectiondependency-scanningdeployment-slotsdeploymentsdeprecationdesign-patternsdevopsdfsdijkstradiscriminated-unionsdistributivedockerdocumentationdotnetdotnet-9drift-detectiondynamic-programminge2e-testingef-coreef-core-9embeddingsengineeringenvironmentserror-budgetevaluationevent-drivenevent-gridevent-hubseventingexamplesfeature-flagsfederationfew-shotfiberfine-tuningflaky-testsflex-consumptionfrontendfunction-callinggenericsgitgithub-actionsgolden-signalsgpt-4ographgraphqlgrpchclhealth-checksheaphookshotchocolatehttphttp2http3hybridcacheiacidempotencyidentityin-context-learningindexesinferinferenceinfrastructureintegrationintegration-testingintrosortisolationjailbreakjestjoinsjotaijsonbjwtk8skey-remappingkey-vaultkiotaknapsackknowledge-basekuberneteslanguagelegacy-codelinqload-balancinglower-boundmanaged-identitymapped-typesmaterialized-viewsmemoizationmemorymergemessage-queuemessagingmetricsmicroservicesminimal-apismockingmocksmodel-routingmodulesmongodbmonitoringmswmulti-agentmulti-stage-buildsmulti-tenantmvccnarrowingnetwork-securitynextjs-16normalizationnosqloauthoauth2observabilityoidcopaopenapiorchestrationoutput-formatowasppaaspactpactflowpage-objectsparsingpartitioningperformancepersonal-AIpgvectorpineconepipelineplanningplaywrightpluginspolicy-as-codepollypostgresqlproductionprompt-designprompt-engineeringprompt-injectionprotobufpulumipythonqualityquality-gatesquantizationqueuesragrate-limitingreactreact-19react-compilerreact-internalsreact-queryreact-server-componentsrealtimereasoningrecursionrecursive-typesred-blackred-green-refactorred-teamingredisregression-testingrelease-managementresource-limitsrestreusable-workflowsrlsrolling-updatesruntime-safetysaga-patternsastsbomscaleschemaschema-designsdlcsecrets-managementsecuritysecurity-testingself-consistencyserializableserver-actionsserverlessservice-busshardingshortest-pathsignalrsnapshot-testingsoftware-designsortingspiessqlstabilitystate-managementstreamsstridestructured-outputstubssupertestsupply-chainsystem-designtail-calltanstack-querytask-framingtddtemplate-literalsterraformtest-architecturetest-doublestest-pyramidtestcontainerstestingtesting-patternstesting-strategythreat-modelingtoken-buckettoken-economicstokenstool-callingtool-usetopological-sorttransactionstreestrietrunk-basedtype-guardstype-predicatestype-systemtype-transformstypescriptunit-testingutility-typesvalidationvalkeyvaultvector-dbvector-searchversion-controlvisual-regressionvitestvulnerabilitiesweaviateweb-apiweb-securitywebsocketswindow-functionswiremockworkload-identityworkspacesxunityarpzero-shotzero-trustzodzustand
Backend (.NET / C#)
C# Generics Mastery: Constraints, Variance, and Generic Math in .NET 9

C# Generics Mastery: Constraints, Variance, and Generic Math in .NET 9

Intermediate

Type-safe abstractions without overhead — constraints, covariance/contravariance, INumber<T>, and the .NET 9 "allows ref struct" anti-constraint.

12 min
Read →
Backend (.NET / C#)
LINQ in .NET 9: Deferred Execution, IQueryable, and the New Operators

LINQ in .NET 9: Deferred Execution, IQueryable, and the New Operators

Intermediate

Practical LINQ for backend engineers — IEnumerable vs IQueryable, the .NET 9 CountBy/AggregateBy/Index additions, and EF Core translation pitfalls.

13 min
Read →
Backend (.NET / C#)
Async/Await in .NET 9: ConfigureAwaitOptions, Task.WhenEach, and Bounded Concurrency

Async/Await in .NET 9: ConfigureAwaitOptions, Task.WhenEach, and Bounded Concurrency

Intermediate

Modern async patterns for ASP.NET Core — context capture, the .NET 8 ConfigureAwaitOptions enum, .NET 9 Task.WhenEach, and the anti-patterns that cause production incidents.

14 min
Read →
Backend (.NET / C#)
Dependency Injection in .NET 9: Lifetimes, Keyed Services, and the Scope Pattern

Dependency Injection in .NET 9: Lifetimes, Keyed Services, and the Scope Pattern

Foundational

Lifetime selection, keyed services (.NET 8+), the BackgroundService scope pattern, and the four DI anti-patterns that cause production bugs.

12 min
Read →
Backend (.NET / C#)
EF Core 9 in Production: Tracking, Projections, and the Performance Levers That Matter

EF Core 9 in Production: Tracking, Projections, and the Performance Levers That Matter

Intermediate

Bulk updates with ExecuteUpdateAsync, projection over Include, AsSplitQuery for cartesian explosion, auto-compiled models, and IDbContextFactory for parallel work.

14 min
Read →
Backend (.NET / C#)
The Repository Pattern in .NET: When It Helps, When It Hurts, and What to Use Instead

The Repository Pattern in .NET: When It Helps, When It Hurts, and What to Use Instead

Intermediate

Why generic IRepository<T> over EF Core is usually an anti-pattern, when domain repositories earn their keep, and the specification pattern as a cleaner alternative.

12 min
Read →
Backend (.NET / C#)
CQRS in .NET Without the Cargo Cult: A Practical Guide for 2026

CQRS in .NET Without the Cargo Cult: A Practical Guide for 2026

Advanced

CQRS as a folder discipline, command/query handlers without MediatR, vertical slice architecture, and when eventual consistency is overkill.

15 min
Read →
Backend (.NET / C#)
Clean Architecture in .NET 9: One Rule, Four Layers, and When to Skip the Whole Thing

Clean Architecture in .NET 9: One Rule, Four Layers, and When to Skip the Whole Thing

Advanced

The dependency rule applied pragmatically — solution layout, port-and-adapter wiring, NetArchTest enforcement, and when Vertical Slice Architecture is the better fit.

14 min
Read →
Backend (.NET / C#)
Minimal APIs in .NET 9: Typed Results, Route Groups, and Endpoint Filters Done Right

Minimal APIs in .NET 9: Typed Results, Route Groups, and Endpoint Filters Done Right

Intermediate

Production-shaped Minimal APIs with typed Results<T>, route groups, endpoint filters, [FromKeyedServices], and the new built-in OpenAPI replacing Swashbuckle.

13 min
Read →
Algorithms & DS
Binary Search: One Template That Solves Every Variant

Binary Search: One Template That Solves Every Variant

Intermediate

Half-open [low, high) invariant, lower-bound and upper-bound, first/last occurrence, binary search on the answer, floating-point search, and the BCL helpers.

12 min
Read →
Algorithms & DS
Sorting in 2026: Introsort, Stability, and When to Reach for Radix

Sorting in 2026: Introsort, Stability, and When to Reach for Radix

Intermediate

.NET introsort vs LINQ stable OrderBy, comparator rules (never a - b), 0/1 vs unbounded knapsack-style iteration, counting sort, and external merge sort for data > RAM.

13 min
Read →
Algorithms & DS
Recursion: When It's Elegant, When It's a Stack Overflow

Recursion: When It's Elegant, When It's a Stack Overflow

Intermediate

Base/recursive/combine, memoization vs iteration, why .NET doesn't reliably tail-call optimize, and converting recursion to an explicit Stack<T> for adversarial depth.

12 min
Read →
Algorithms & DS
Dynamic Programming: State, Recurrence, Base Case, Order

Dynamic Programming: State, Recurrence, Base Case, Order

Advanced

Top-down memoization vs bottom-up tables, coin change, 0/1 knapsack with reverse iteration, edit distance, LIS in O(n log n), and reconstructing the solution.

15 min
Read →
Algorithms & DS
Trees: BSTs, Balance, and Why SortedDictionary Is Red-Black

Trees: BSTs, Balance, and Why SortedDictionary Is Red-Black

Intermediate

BST vs self-balancing (red-black, AVL), B-trees in databases, heaps with PriorityQueue, tries for prefix queries, and iterative traversals that don't blow the stack.

13 min
Read →
Algorithms & DS
Graph Traversal: BFS, DFS, Topological Sort, and the Visited Set

Graph Traversal: BFS, DFS, Topological Sort, and the Visited Set

Intermediate

Adjacency list vs matrix, BFS for unweighted shortest path, DFS recursive vs iterative, Kahn's topological sort, three-colour cycle detection, and connected components.

13 min
Read →
Algorithms & DS
Dijkstra in C#: PriorityQueue, A*, and Why Negative Edges Break It

Dijkstra in C#: PriorityQueue, A*, and Why Negative Edges Break It

Advanced

Production Dijkstra with .NET PriorityQueue and the skip-stale pattern, path reconstruction, A* with admissible heuristics, multi-source variants, and Bellman-Ford for negatives.

14 min
Read →
Databases
PostgreSQL 17/18 in 2026: MVCC, Indexes, and EF Core 9

PostgreSQL 17/18 in 2026: MVCC, Indexes, and EF Core 9

Intermediate

PG 17 (Sept 2024) async I/O, PG 18 (Sept 2025) features, MVCC + xmin/xmax, btree/GIN/GiST/BRIN, JSONB jsonb_path_ops, partial/functional indexes, EF Core 9 + Npgsql 9, EXPLAIN (ANALYZE, BUFFERS), VACUUM and PgBouncer pitfalls.

15 min
Read →
Databases
SQL Patterns: Joins, Window Functions, MERGE, and Killing N+1

SQL Patterns: Joins, Window Functions, MERGE, and Killing N+1

Intermediate

N+1 to JOIN/LATERAL, EXISTS vs IN vs JOIN, ROW_NUMBER/RANK/SUM OVER, ANSI MERGE in PG 15+, ON CONFLICT upsert, Dapper parameterization, EXPLAIN read guide, NULL semantics + OR-defeats-index pitfalls.

14 min
Read →
Databases
Transactions and Isolation: ANSI Levels, MVCC, and SERIALIZABLE

Transactions and Isolation: ANSI Levels, MVCC, and SERIALIZABLE

Advanced

Four ANSI levels, MVCC vs 2PL, EF Core 9 BeginTransactionAsync, [Timestamp] rowversion optimistic concurrency, FOR UPDATE SKIP LOCKED, write-skew, retry on 40001/40P01 with exponential backoff, transactional outbox over 2PC.

14 min
Read →
Databases
Redis 8 / Valkey in 2026: HybridCache, Streams, and Distributed Locks

Redis 8 / Valkey in 2026: HybridCache, Streams, and Distributed Locks

Intermediate

Redis 8 SSPL/RSALv2 + Valkey LF fork, Azure Cache Enterprise, .NET 9 HybridCache (L1+L2 + stampede protection), atomic rate limit, SET NX EX + Lua compare-and-delete locks, Streams + consumer groups, sorted-set leaderboards, TTL jitter.

14 min
Read →
Databases
MongoDB 8.x: Embed vs Reference, ESR Indexes, and the Aggregation Pipeline

MongoDB 8.x: Embed vs Reference, ESR Indexes, and the Aggregation Pipeline

Intermediate

MongoDB 8.0 (Oct 2024) / 8.2, queryable encryption GA, Cosmos DB for MongoDB vCore + DocumentDB, MongoDB.Driver 3.x LINQ, embed-vs-reference rule, ESR compound indexes, partial/TTL indexes, aggregation pipeline, atomic positional updates.

13 min
Read →
Databases
Azure Cosmos DB: Partition Keys, RUs, and the Five Consistencies

Azure Cosmos DB: Partition Keys, RUs, and the Five Consistencies

Advanced

Cosmos DB SQL API, 5 consistency levels, partition-key design (10GB cap, hot-partition avoidance), RU/s autoscale vs serverless, CosmosClient v3 Direct mode + DefaultAzureCredential, point reads (1 RU), change feed, hierarchical partition keys, vector search GA.

15 min
Read →
Databases
pgvector 0.8/0.9: HNSW, halfvec, and RAG on Postgres

pgvector 0.8/0.9: HNSW, halfvec, and RAG on Postgres

Advanced

pgvector 0.8 (Oct 2024) iterative scans + halfvec, 0.9 sparse vectors, HNSW vs IVFFlat, EF Core 9 + Pgvector.EntityFrameworkCore, halfvec/bit quantization, hybrid search with tsvector, maintenance_work_mem for builds.

14 min
Read →
Databases
Pinecone Serverless: Namespaces, Hybrid Search, and Reranking

Pinecone Serverless: Namespaces, Hybrid Search, and Reranking

Intermediate

Pinecone serverless GA (2024), namespaces for multitenancy, sparse-dense hybrid, .NET PineconeClient, batch upserts, metadata filtering, built-in rerankers (BGE/Cohere), tenant offboarding via DeleteAll.

13 min
Read →
Databases
Weaviate 1.27+: Multi-Tenancy, Dynamic Indexes, and Generative Search

Weaviate 1.27+: Multi-Tenancy, Dynamic Indexes, and Generative Search

Advanced

Weaviate 1.27/1.28 multi-tenancy, dynamic indexes (flat → HNSW), text2vec/generative modules, gRPC v4 clients, hybrid alpha, generative-openai for RAG-in-one-call, tenant offboarding.

14 min
Read →
Databases
Normalization: 1NF to 3NF, Denormalize Reads, Snapshot Truths

Normalization: 1NF to 3NF, Denormalize Reads, Snapshot Truths

Intermediate

1NF/2NF/3NF/BCNF in plain English, when to denormalize via materialized views or CQRS read models, snapshots vs duplication, REFRESH MATERIALIZED VIEW CONCURRENTLY, propagating changes via CDC.

12 min
Read →
API Design
REST Principles in 2026: Resources, Idempotency, and Problem Details

REST Principles in 2026: Resources, Idempotency, and Problem Details

Intermediate

The five constraints that still matter (resources, methods, status codes, statelessness, cacheability), idempotency keys, RFC 9457 problem+json, cursor pagination over OFFSET, ETags + 304s, ASP.NET Core 9 MapGroup.

13 min
Read →
API Design
GraphQL with HotChocolate 14: Projections, DataLoaders, and Federation

GraphQL with HotChocolate 14: Projections, DataLoaders, and Federation

Advanced

When GraphQL beats REST and when it does not, HotChocolate 14 on .NET 9 with [UseProjection] + source-generated DataLoaders, persisted operations, cost analysis, Apollo Federation v2 with @key fields.

14 min
Read →
API Design
gRPC on .NET 9: HTTP/3, Streaming, Deadlines, and JSON Transcoding

gRPC on .NET 9: HTTP/3, Streaming, Deadlines, and JSON Transcoding

Advanced

Four call patterns (unary/server/client/bidi), .NET 9 server + strongly-typed client over HTTP/3, deadlines + ServiceConfig retry policies, gRPC-Web for browsers, JSON transcoding so one service speaks gRPC and REST.

14 min
Read →
API Design
WebSockets and SignalR: Heartbeats, Backplanes, and CSWSH Defense

WebSockets and SignalR: Heartbeats, Backplanes, and CSWSH Defense

Intermediate

WebSocket vs SignalR vs SSE vs WebTransport, .NET 9 SignalR Hub + MapHub, scale-out with Redis backplane or Azure SignalR Service, KeepAliveInterval heartbeats, JWT in query string, backpressure with Channels.

13 min
Read →
API Design
API Versioning: URL, Header, Media Type, and Sunset Discipline

API Versioning: URL, Header, Media Type, and Sunset Discipline

Intermediate

Asp.Versioning 8 on .NET 9, URL/query/header/media-type schemes, additive evolution, one domain with multiple wire mappers, RFC 8594 Sunset + Deprecation headers, per-version OpenAPI documents.

12 min
Read →
API Design
Rate Limiting on .NET 9: Token Buckets, Redis, and Tiered Policies

Rate Limiting on .NET 9: Token Buckets, Redis, and Tiered Policies

Intermediate

Built-in RateLimiter middleware with FixedWindow/SlidingWindow/TokenBucket/Concurrency, partition by user/API key, distributed counters with Redis Lua INCR/EXPIRE, 429 + Retry-After + RateLimit-* headers, layered with APIM.

13 min
Read →
API Design
OpenAPI 3.1 on .NET 9: Built-in Spec, Scalar UI, and Kiota Clients

OpenAPI 3.1 on .NET 9: Built-in Spec, Scalar UI, and Kiota Clients

Intermediate

Microsoft.AspNetCore.OpenApi replacing Swashbuckle, OpenAPI 3.1 with JSON Schema 2020-12, Scalar / Redoc UIs, schema + document transformers, Kiota / NSwag SDK generation, Spectral lint + oasdiff in CI.

13 min
Read →