AI Wisdom

Tag

csharp

33 articles tagged with “csharp”

A/B-testinga-starA2AACRadaptive-thinkingagent-observabilityagent-patternsagent-protocolsagent-securityagent-skillsagentsAGENTS.mdaggregationaiai-gatewayAI-SearchaksalertingAlertmanageralgorithmsAnthropicAnthropic-APIAPEapi-designapi-gatewayAPI-providersapi-versioningapimAPMapp-routerapp-serviceappsecarchitectureArizearm-templatesASP.NET-Coreaspnet-coreaspnetcoreassertion-functionsassertsasyncauditauthenticationauthorizationAutoGenautomationazureAzure-APIMazure-content-safetyazure-front-doorazure-functionsAzure-OpenAIazure-policyazure-storagebatch-APIbddbeam searchBedrockbenchmarksbest-practicesbfsbi-encoderbias-detectionbicepbinary-searchbranchingbstBundlercache-componentscachingcap-theoremcapability-taggingCapitalizecascadingcase-based-reasoningchain-of-thoughtchartschatbotcheckpointingchunkingCIci-cdci-optimizationcicdclass-decoratorClaudeClaude-CodeCLAUDE.mdclean-architecturecloudcloud-securitycloudeventscode-reviewCodexcoding-agentscompactioncomparisoncompilerOptionscompliancecomposeconcurrencyconcurrent-renderingconditional-typesconsistencyconsistent-hashingconstrained-generationconstraintsconsumer-drivencontainer-registrycontainerscontent-moderationcontent-safetycontextcontext-compressioncontext-engineeringcontext-windowcontract-testingconversational-agentsCopilotcosmos-dbcost-allocationcost-controlcost-optimizationcost-per-taskcost-performanceCoTcoveragecqrscross-sessioncsharpCursorcvecypress.d.tsdapperdashboardsdastdata-fetchingdatabasesdataloaderdatasetsddddecision-frameworkdeclaration-filesdecoratorsDeepEvalDefinitelyTypeddependency-injectiondependency-scanningdeployment-slotsdeploymentsdeprecationdesign-patternsdevopsdfsdijkstradiscriminated-unionsdistributed-tracingdistributivedockerDocker-HubdocumentationDORAdotnetdotnet-9drift-detectionDSPydurable-executiondynamic-discoverydynamic-programminge2e-testingedge AIef-coreef-core-9embeddingsengineeringenvironmentsepisodic-memoryerror-budgetevalsevaluationevent-drivenevent-gridevent-hubseventingexamplesexperience-replayexperimentalDecoratorsfactualityfail-fastfaithfulnessfeature-flagsfederationfew-shotfiberfine-tuningFinOpsflaky-testsflex-consumptionfrontendfunction-callinggarakGeminiGemmagen-ai-semantic-conventionsgenericsGHCRgitGitFlowGitHubgithub-actionsgoal-decompositiongolden-signalsGoogle-DeepMindGPTgpt-4oGPT-6GPUgrammargraphgraphqlGroqgroundingGroupChatgrpcguardrailshallucinationhallucination-detectionharmful-contentharness-engineeringhclhealth-checksheapHelmhookshotchocolateHPAhttphttp2http3hybridcacheiacICLidempotencyidentityimage-scanningin-context-learningincident-responseindexesinferinferenceinfrastructureinput-validationintegrationintegration-testinginteroperabilityintrosortinvariantisolationIstiojailbreakjestjoinsjotaiJSONJSON-modejsonbjwtk8skey-remappingkey-vaultkiotaknapsackknowledge-baseKQLkubernetesKV cacheLangChainLangfuseLangGraphLangSmithlanguagelatencyleast-agencylegacy-codeLinkerdlinqLlamallama.cppLLMLLM-as-judgeLLM-monitoringLLM-securityload-balancinglogginglong-running-agentslong-term-memorylost-in-the-middlelower-boundmanaged-identitymapped-typesmaterialized-viewsMCPmemoizationmemorymemory-consolidationmergemessage-queuemessagingmeta-promptingmetadatametricsmicroservicesmicrosoftminimal-apisMistralmockingmocksModel-Context-Protocolmodel-routingmodel-selectionmodel-servingmoderationmodule-augmentationmodule-resolutionmodulesmongodbmonitoringmonorepomswMTEBmTLSmulti-agentmulti-stage-buildsmulti-tenantmultimodalmvccnarrowingnetwork-securitynextjs-16Node16normalizationnosqloauthoauth2observabilityoffline-evalsoidcOmiton-callon-deviceonline-evalsopaopen-sourceopen-weightOpenAIOpenAI-APIopenapiOpenTelemetryOPROorchestrationOTELOutlinesoutput-formatoutput-validationOWASPP99paaspackage-exportspactpactflowpage-objectsPagerDutyparsingPartialpartitioningpathspattern-matchingperformancepersonal-AIpgvectorPhiPhoenixPickPIIPII-filteringpineconepipelineplanningplaywrightpluginspolicy-as-codepollypostgresqlpricingproductionproduction-monitoringprogressive-disclosureproject-referencesprompt-cachingprompt-designprompt-engineeringprompt-injectionprompt optimisationpromptfooprotobufpulumipythonQdrantqualityquality-gatesquality-scorequantizationqueuesRAGRAG-evaluationRAGASrate-limitingreactreact-19react-compilerreact-internalsreact-queryreact-server-componentsrealtimereasoningreasoning-effortRecordrecursionrecursive-typesred-blackred-green-refactorred teamingredisreflectionregression-testingrelease-managementreplanningresource-limitsResponses-APIrestreusable-workflowsrlsrolling-updatesruntime-safetysaga-patternsandboxingsastsbomscaleschemaschema-designschema-validationSDKsdlcsearchsecrets-managementsecuritysecurity-testingself-consistencyself-hostingSemantic-Kernelsemantic-similarityserializableserver-actionsserverlessservice-busservice-meshshardingshortest-pathsidecar-proxysignalrSKILL.mdSLISLMSLOslopsquattingsnapshot-testingsoftware-designsortingspec-driven-developmentspeculative-decodingspiessqlstabilitystate-graphstate-managementstreamingstreamsstrict-modestridestring-typesstructured-loggingstructured-outputstubssummarisationsupertestsupply-chainsystem-designtail-calltanstack-querytask-framingTC39tddtemplate-literalstemplatesterraformtest-architecturetest-doublestest-pyramidtestcontainerstestingtesting-patternstesting-strategythreat-modelingtoken-buckettoken-budgettoken-economicstoken-limittoken-maskingtoken-trackingtokenstokens-per-secondtool-callingtool-registrytool-usetopological-sortToTtoxicitytracingtrajectorytransactionstree-of-thoughttreestrietrunk-basedtsconfigTTFTtype-guardstype-narrowingtype-predicatestype-safe-routestype-systemtype-transformstypestypescriptunit-testingusage-metricsuser-feedbackutility-typesvalidationvalkeyvaluesvaultvector-dbvector-searchvector-storevendor-neutralverificationversion-controlversioningVertex-AIvisual-regressionvitestvLLMvoice-agentsvulnerabilitiesweaviateweb-apiweb-securityWebLLMwebsocketswindow-functionsWindsurfwiremockworkflowsworking-memoryworkload-identityworkspacesxunityarpzero-shotzero-trustzodzustand
Backend (.NET / C#)
Report codeOne generic SumConstraintReports

C# Generics Mastery: Constraints, Variance, and Generic Math

Intermediate

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

Updated 12 min
Read →
Backend (.NET / C#)
Sales reportLINQ queryDatabase

LINQ in .NET: 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.

Updated 13 min
Read →
Backend (.NET / C#)
ShoppersCheckout APIConcurrency limitDatabasePayment partner

Async/Await in .NET: 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.

Updated 14 min
Read →
Backend (.NET / C#)
RequestsOrder APISingleton cacheScope factoryDbContextBackground worker

Dependency Injection in .NET: 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.

Updated 12 min
Read →
Backend (.NET / C#)
Admin screensAdmin APIContext factoryDbContextDatabase

EF Core 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.

Updated 14 min
Read →
Backend (.NET / C#)
Application serviceOrder repositoryDbContextDatabaseReal DB tests

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.

Updated 12 min
Read →
Backend (.NET / C#)
ScreensOrder APICommand handlersQuery handlersDatabase

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

AdvancedPRO

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

Updated 15 min
Read →
Backend (.NET / C#)
Web hostApplicationDomainInfrastructureDatabaseArchitecture test

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

AdvancedPRO

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

Updated 14 min
Read →
Backend (.NET / C#)
ClientsRoute groupEndpoint filterHandlerDatabaseOpenAPI

Minimal APIs in .NET: 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.

Updated 13 min
Read →
Algorithms & DS
Binary search with one invariant: the half-open range low to high shrinks each step using an overflow-safe midpoint until low equals high at the lower bound, finding a position in 10 million sorted items in about 24 comparisons.Binary search with one invariant: the half-open range low to high shrinks each step using an overflow-safe midpoint until low equals high at the lower bound, finding a position in 10 million sorted items in about 24 comparisons.

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.

Updated 12 min
Read →
Algorithms & DS
Sorting done right: use the library sort with a chained comparator that never subtracts, a stable sort or unique final key for deterministic ties, and sort large data in the database or stream it instead of loading it into memory.Sorting done right: use the library sort with a chained comparator that never subtracts, a stable sort or unique final key for deterministic ties, and sort large data in the database or stream it instead of loading it into memory.

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.

Updated 13 min
Read →
Algorithms & DS
Safe recursion over a category tree: every call has a base case and makes progress, a visited set detects cycles in imported data, an explicit stack replaces the call stack for unbounded depth, and memoisation removes repeated work.Safe recursion over a category tree: every call has a base case and makes progress, a visited set detects cycles in imported data, an explicit stack replaces the call stack for unbounded depth, and memoisation removes repeated work.

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.

Updated 12 min
Read →
Algorithms & DS
Dynamic programming for edit distance: define the subproblem, write the recurrence, fill a table bottom-up so each cell is computed once, keep only two rows, and stop early when a row exceeds the allowed distance.Dynamic programming for edit distance: define the subproblem, write the recurrence, fill a table bottom-up so each cell is computed once, keep only two rows, and stop early when a row exceeds the allowed distance.

Dynamic Programming: State, Recurrence, Base Case, Order

AdvancedPRO

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.

Updated 15 min
Read →
Algorithms & DS
Choosing a tree: a trie with top completions stored at each node serves prefix autocomplete, a self-balancing tree keeps ordered data logarithmic whatever the insert order, and stored data uses the database’s B-tree indexes.Choosing a tree: a trie with top completions stored at each node serves prefix autocomplete, a self-balancing tree keeps ordered data logarithmic whatever the insert order, and stored data uses the database’s B-tree indexes.

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.

Updated 13 min
Read →
Algorithms & DS
Graph traversal on service dependencies: Kahn’s topological sort produces a deploy order and reports cycles as leftover nodes, BFS lists the blast radius by hops, and every traversal keeps a visited set.Graph traversal on service dependencies: Kahn’s topological sort produces a deploy order and reports cycles as leftover nodes, BFS lists the blast radius by hops, and every traversal keeps a 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.

Updated 13 min
Read →
Algorithms & DS
Dijkstra’s shortest path for delivery routing: start at distance zero, repeatedly pop the closest junction from a min-heap, skip stale entries, relax each road by travel minutes, and stop when the destination is popped; A* adds a distance estimate.Dijkstra’s shortest path for delivery routing: start at distance zero, repeatedly pop the closest junction from a min-heap, skip stale entries, relax each road by travel minutes, and stop when the destination is popped; A* adds a distance estimate.

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

AdvancedPRO

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

Updated 14 min
Read →
Databases
CustomersStore APIorders tableQuery planMatching indexAutovacuumPgBouncer

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

Intermediate

PostgreSQL 18 asynchronous I/O and PostgreSQL 19 changes, MVCC + xmin/xmax, btree/GIN/GiST/BRIN, JSONB jsonb_path_ops, partial/functional indexes, EF Core + Npgsql, EXPLAIN (ANALYZE, BUFFERS), VACUUM and PgBouncer pitfalls.

Updated 17 min
Read →
Databases
AnalystReport codeOne set-based queryDatabaseIndex on the sortQuery plan

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.

Updated 16 min
Read →
Databases
Buyer ABuyer BCheckoutRow lockStock rowordersOutbox

Transactions and Isolation: ANSI Levels, MVCC, and SERIALIZABLE

AdvancedPRO

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

Updated 14 min
Read →
Databases
ShoppersStore appRedisDatabaseCartsTop sellers

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

Intermediate

Redis 8 tri-licensing (AGPLv3, SSPLv1, or RSALv2) + the Valkey LF fork, Azure Cache Enterprise, HybridCache (L1+L2 + stampede protection), atomic rate limiting, SET NX EX + Lua compare-and-delete locks, Streams + consumer groups, sorted-set leaderboards, and TTL jitter.

Updated 14 min
Read →
Databases
ShoppersCatalogue APIproductsreviewsSchema validatorCompound index

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.

Updated 13 min
Read →
Databases
CustomersStore APIPartition APartition BPartition CChange feedRead view

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

AdvancedPRO

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.

Updated 15 min
Read →
Databases
ShoppersStore APIPostgresEmbedding columnHNSW indexFull-text searchDedicated vector DB

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

AdvancedPRO

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

Updated 14 min
Read →
Databases
CustomersHelp-centre appYour databaseServerless indexTenant A namespaceTenant B namespaceReranker

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.

Updated 13 min
Read →
Databases
Support agentsSearch appWeaviateKeyword scoreVector scoreLabelled queries

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

AdvancedPRO

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.

Updated 14 min
Read →
Databases
CustomerStore appcustomersordersorder_itemsRead model

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.

Updated 12 min
Read →
API Design
PartnersOrders APIOrdersIdempotency keysProblem DetailsOperation status

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.

Updated 15 min
Read →
API Design
Mobile appGraphQL serverResolversDatabaseDataLoaderPersisted queriesCost limit

GraphQL with HotChocolate 16: Projections, DataLoaders, and Federation

AdvancedPRO

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

Updated 16 min
Read →
API Design
CheckoutShared .protoPricing pod APricing pod BPricing pod CLayer-7 balancingBreaking-change check

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

AdvancedPRO

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

Updated 16 min
Read →
API Design
DashboardsLoad balancerServer AServer BBackplaneRecent eventsOrder events

WebSockets and SignalR: Heartbeats, Backplanes, and CSWSH Defense

Intermediate

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

Updated 15 min
Read →
API Design
PartnersVersion routingv1 mappingv2 mappingOne domain coreUsage by client

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

Intermediate

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

Updated 12 min
Read →
API Design
Free planEnterprise planPer-key limiterOrders APIDatabaseShared counter

Rate Limiting on .NET: 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.

Updated 15 min
Read →
API Design
Your teamAPI codeOpenAPI specGenerated clientsPartnersLint and diffContract tests

OpenAPI 3.1 on .NET: 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.

Updated 15 min
Read →