.NET Concepts

.NET platform and application architecture concepts explained in depth, one at a time.

Sort

Runtime & SDK

Project System

1
Platform & Tooling🔬 Lab

SDK-Style Projects, MSBuild and Directory.Build.props

What Sdk="Microsoft.NET.Sdk" imports, implicit globbing and how to inspect it (-getItem, -pp, binlog), Directory.Build.props versus .targets and their evaluation-order traps, .slnx and ArtifactsPath, all measured on SDK 10.0.100.

2
Platform & Tooling

Assemblies, Frameworks and How the Host Resolves Them

Assembly identity, reference versus implementation assemblies, real deps.json and runtimeconfig.json, the host trace (DOTNET_ROOT, roll-forward), why a DLL in the folder is not found, [TypeForwardedTo] and AssemblyLoadContext isolation.

3
Platform & Tooling

The dotnet CLI and the Noun-First Commands

CLI anatomy, the .NET 10 noun-first commands (and a reference add failure seen on SDK 10.0.100), -p: and where it breaks, tool manifests, dotnet tool exec and dnx, dotnet watch hot reload, --cli-schema and .slnf solution filters in dotnet sln (.NET 11), measured on SDKs 10.0.100 and 11.0.100.

4
Platform & Tooling

Analyzers, EditorConfig and Build Quality Gates

CA and IDE rules and when each runs in dotnet build, AnalysisMode and AnalysisLevel with measured warning counts (and the latest trap on SDK 10.0.100), severity and precedence in .editorconfig and .globalconfig, TreatWarningsAsErrors and its siblings including the NuGet audit effect, suppressions and the trace they leave, nullable as a gate, third-party analyzers with PrivateAssets, and dotnet format in CI.

5
Platform & Tooling

MSBuild Custom Targets, Tasks and Binary Logs

The two MSBuild phases and why a property read in the wrong place is empty, targets with BeforeTargets, AfterTargets and DependsOnTargets, Inputs and Outputs with measured timings, items with batching and transforms, Exec, Warning and Error, Directory.Build.targets, inline and compiled tasks (PrivateAssets, TaskHostFactory) and diagnosis with a binlog read from code, PerformanceSummary and -check, plus what the .NET 11 SDK changed.

NuGet & Packaging

1
Platform & Tooling🔬 Lab

NuGet Restore, Versions and Dependency Resolution

Version notation, the restore resolution rules (lowest applicable version, direct dependency wins), floating versions and lock files, NuGetAudit, and what changed in restore in .NET 9 and .NET 10.

2
Platform & Tooling🔬 Lab

Central Package Management and Package Source Mapping

Centralize versions in Directory.Packages.props (VersionOverride, transitive pinning, global references) and map package IDs to feeds in nuget.config to stop dependency confusion, with the real errors and the limits of each.

3
Platform & Tooling🔬 Lab

Packaging and Publishing a NuGet Library

How dotnet pack turns a project into a package (metadata, readme, symbols, Source Link), the SemVer and VersionSuffix rules, package validation catching a CP0002 breaking change, testing the package from a local feed, and what pushing to nuget.org or a private feed means.

4
Platform & Tooling

Multi-Targeting and .NET Standard

What TargetFrameworks produces in a package, how NuGet picks the assembly for a net8.0 or net10.0 consumer, #if symbols, polyfills such as IsExternalInit, what netstandard2.0 is still for, and which C# features survive on an old target.

5
Platform & Tooling🔬 Lab

NuGet Supply Chain: Audit, Lock Files and Minimum Publish Age

Defense in depth for NuGet with real output from the 11.0.100 SDK: NuGetAudit modes and levels, packages.lock.json with --locked-mode (NU1004 versus NU1403), transitive pinning, package signatures and the new minimum publish age (minPublishAgeHours, NU1020).

6
Platform & Tooling

CI/CD for .NET: GitHub Actions, SBOM, SourceLink and Signing

A build, test and publish pipeline measured on a toy library: locked restore with and without cache, coverlet, ReportGenerator and MTP coverage with a failing gate, deterministic builds (what changes the hash), SourceLink read from the PDB, MinVer versions from tags, NuGetAudit on a real vulnerable package, CycloneDX and SPDX SBOMs, dotnet nuget sign with a test certificate, push with --skip-duplicate, and trusted publishing, attestations and pipeline security from the docs.

Publishing & Native AOT

1
Platform & Tooling🔬 Lab

Self-Contained, Single-File and Trimmed Publishing

Framework-dependent versus self-contained, RIDs, single file (IL3000, extracted native libraries, compression), trimming with real IL2026/IL2057/IL2070 warnings and DynamicallyAccessedMembers, feature switches (HTTP/3 off in .NET 10) and the startup surprise between trimming and ReadyToRun, with measured sizes and times.

2
Platform & Tooling🔬 Lab

Native AOT and Its Limits

What PublishAot does (ILC, the native linker, no cross-OS builds), what it buys in startup, memory and size measured on a console app and a minimal API, what breaks and why (Reflection.Emit, dynamic, generics over structs, LoadFrom, interpreted expression trees), the JSON failure that has no warning, and where ASP.NET Core and EF Core stand in .NET 10.

3
Platform & Tooling🔬 Lab

Source Generators and AOT-Friendly Code

How [GeneratedRegex], JsonSerializerContext and [LoggerMessage] replace reflection with compile-time code, how to read the generated files (and the duplicate-definition trap), the IL2026 and IL3050 warnings on the reflection path, and a small IIncrementalGenerator built and run on SDK 10.

4
Platform & Tooling

Containerizing .NET: SDK Publish, Dockerfile and Chiseled Images

Two routes to a .NET 10 container image, the SDK's PublishContainer (no Dockerfile, no daemon) and a multi-stage Dockerfile, with the inferred base image (Ubuntu 24.04 for 10.0), the rootless user 1654, the image config and layers read from a tar archive, chiseled and Alpine families measured by size, multi-arch images, the LocalRegistry property and reproducible digests with SOURCE_DATE_EPOCH in .NET 11, registry authentication, and what missing ICU does to culture-sensitive code.

Diagnostics

ASP.NET Core Fundamentals

Hosting & Pipeline

1
ASP.NET Core

Kestrel, IIS and Hosting Models

Kestrel alone or behind a reverse proxy, forwarded headers and the trusted proxy list, server limits, IIS in-process versus out-of-process, and memory eviction in ASP.NET Core 10.

2
ASP.NET Core🔬 Lab

The Middleware Pipeline and Program.cs

Use, Run and Map, what WebApplication adds automatically, the recommended order, short-circuiting, convention middleware versus IMiddleware, and environments.

3
ASP.NET Core

HTTPS, HSTS and Secure Defaults

HTTPS redirection and the port it must discover, HSTS defaults and a safe rollout, RedirectHttpResult.IsLocalUrl against open redirects, what APIs should do with plain HTTP, and the development certificate.

4
ASP.NET Core

Static Files and MapStaticAssets

The build-time manifest, fingerprinting and precompression behind MapStaticAssets, the headers the server sends, what it will not serve, when UseStaticFiles is still needed, and the effect of ShortCircuit.

5
ASP.NET Core

Choosing an ASP.NET Core Application Model

Minimal APIs, controllers, Razor Pages, MVC, Blazor, gRPC and SPA plus API side by side: what each .NET 10 template really generates, what the shared host gives all of them, and where per-model defaults still differ, measured with real requests.

6
ASP.NET Core🔬 Lab

Response Compression: Brotli, Gzip and Zstandard

The ASP.NET Core response compression middleware, the zstd, br and gzip providers, Vary: Accept-Encoding on every response in .NET 11, HTTPS and BREACH, when to leave compression to the proxy, and size and time measured on a 371 KB payload.

Minimal APIs

1
ASP.NET Core🔬 Lab

Parameter Binding and Endpoint Filters

The order in which a parameter's source is chosen, binding failure codes, AsParameters, custom TryParse and BindAsync, forms with antiforgery, and AddEndpointFilter.

2
ASP.NET Core🔬 Lab

ProblemDetails and Global Exception Handling

The RFC 9457 problem+json document, why AddProblemDetails alone leaves a 404 empty, IExceptionHandler chains, CustomizeProblemDetails, and keeping exception details out of responses.

3
ASP.NET Core

Route Constraints, Short-Circuit Routes and Handler Results

Route constraints that decide whether a route matches (404 versus 400), regex escaping pitfalls, custom constraints, ShortCircuit and MapShortCircuit, and what each kind of handler return value turns into.

4
ASP.NET Core

JSON Patch and Partial Updates

PUT versus PATCH, RFC 6902 operations applied to C# objects with the new System.Text.Json package in .NET 10, why a failure halfway does not roll anything back, a safe PATCH endpoint with a DTO and validation, the threats the framework leaves to you, and merge patch as the alternative.

5
ASP.NET Core🔬 Lab

Async Validation with Data Annotations

AsyncValidationAttribute and IAsyncValidatableObject in .NET 11 Minimal APIs for rules that query a database or a service, the order in which rules run, the ProblemDetails response, cancellation through the request token, asynchronous options validation at host startup (IAsyncStartupValidator and IAsyncValidateOptions), and what was left out because it was not executed.

6
ASP.NET Core🔬 Lab

HTTP QUERY: Safe Requests With a Body

The QUERY method (RFC 10008) as a safe and idempotent search with a body: MapMethods and HttpMethod.Query in .NET 11, redirects and retries on HttpClient, why output caching skips it and how to key it by body, the CORS preflight, OpenAPI 3.2 against 3.1, and what was tested against what only the docs claim.

MVC & Razor Pages

API Documentation

HTTP Clients

Security

1
ASP.NET Core🔬 Lab

Authentication and Authorization Fundamentals

Schemes and handlers, challenge versus forbid, cookie versus bearer and the .NET 10 cookie redirect change, claims, roles and policies, resource-based authorization and pipeline wiring mistakes, with the real 401/403 of each request.

2
ASP.NET Core

JWT Bearer Tokens and ASP.NET Core Identity

What the JWT bearer handler validates and what it lets through (a 5 minute clock skew), why claims arrive under odd names, the opaque tokens of MapIdentityApi, what refresh, logout and the security stamp really revoke, passkeys in .NET 10, and where a browser should keep tokens.

3
ASP.NET Core

OpenID Connect, Entra ID and the BFF Pattern

Signing in with OpenID Connect in ASP.NET Core (code flow with PKCE, PAR by default, the cookie as session, SaveTokens, claim mapping, RP-initiated and front-channel logout, Correlation failed and message.State errors behind proxies and replicas), protecting an API with Microsoft.Identity.Web (audience, issuer, scp versus roles, v1 and v2 tokens, downstream calls) and the BFF pattern for SPAs, all observed against a local OpenID provider.

4
ASP.NET Core

Data Protection: Key Ring and Purposes

The ASP.NET Core Data Protection system behind auth cookies, antiforgery tokens and OIDC state: IDataProtector, the payload format, purposes and isolation, time-limited payloads, the key ring on disk with its dates and rolling, SetApplicationName, EF Core and certificate protection, and two real cookie-auth instances with separate rings, a shared ring and a simulated redeploy, with the measured result of each experiment.

5
ASP.NET Core

Cryptography: Hashing, HMAC, AES-GCM and Password Hashing

Choosing the .NET primitive by the job, with measurements: SHA256.HashData, why a fast hash is wrong for passwords, PBKDF2 with a random salt, the real format of Identity's PasswordHasher, constant-time comparison, HMAC, signatures, AesGcm tamper detection and nonces, the SYSLIB diagnostics on legacy APIs, RandomNumberGenerator, the .NET 10 post-quantum types and the .NET 11 additions (X25519, AES Key Wrap, HPKE, composite ML-KEM).

6
ASP.NET Core🔬 Lab

CSRF Protection: Antiforgery Tokens and Fetch Metadata

The two CSRF defenses of ASP.NET Core, the antiforgery token and the .NET 11 automatic check by Sec-Fetch-Site and Origin, which one has the final verdict, how to open a webhook or a trusted partner site, what a JSON endpoint does not get and how DisableAntiforgery and DisableCsrfProtection behave, with the status code of each case from tests that send the headers.

Identity & Access

1
ASP.NET Core

OAuth 2.0 Clients in .NET Code: PKCE, Client Credentials and Device Flow

A .NET app as the OAuth client, written in C# and measured against Keycloak: a client-credentials token handler with a single refresh under 50 concurrent callers (1 token request against 50), one renewal on 401 and where it sits relative to the retry handler, MSAL and Duende.AccessTokenManagement compared with the hand-written version (Duende license read from the vendor pages), private_key_jwt, authorization code with PKCE on a loopback listener, the device flow with slow_down and expiry, refresh rotation and reuse, and where tokens and secrets rest.

2
ASP.NET Core

Building an Authorization Server with OpenIddict

An OAuth 2.0 and OpenID Connect server in ASP.NET Core with OpenIddict 7.9.0, measured with curl against a SQLite lab and a separate API: the four tables, PKCE and exact redirect_uri errors, claim destinations, encrypted access tokens versus JWT, introspection, revocation and entry validation, refresh rotation and reuse, key rotation, reference tokens, PAR, mTLS and the missing DPoP; and when not to build one, against Duende IdentityServer and ready-made products.

3
ASP.NET Core

Secrets and Managed Identities: Key Vault and Workload Identity

From the secret ladder (appsettings, user-secrets, environment variables, measured with GetDebugView) to the DefaultAzureCredential chain and why docs say to replace it in production, ManagedIdentityCredential against a fake App Service identity endpoint (token request, cache, retries, 429, timeouts), WorkloadIdentityCredential against a fake token endpoint that validates the client_assertion JWT, and Key Vault through the Lowkey Vault emulator (versions, soft delete, the configuration provider, rotation, vault down). Real Azure parts, Vault/OpenBao and the secrets-in-CI bridge are docs only, and it ends with a table of where a secret lives.

4
ASP.NET Core

MFA with TOTP and Recovery Codes in ASP.NET Core Identity

The ASP.NET Core Identity second factor measured with the real UserManager and SignInManager (net10.0, EF Core SQLite) and an independent TOTP checked against the 18 RFC 6238 vectors: the key, the otpauth URI and the QR code the framework does not draw, the five-step clock window, reuse of a code inside the window (the default does not stop it) and a provider that does, single-use recovery codes stored in clear text and ProtectPersonalData, lockout shared with the password, the cookies of the two-step sign-in and remember-this-machine, the MapIdentityApi /manage/2fa request and response shapes, a step-up policy with an mfa_at claim that survives security stamp refresh, and what the .NET 10 passkey support is and is not.

5
ASP.NET Core

Client Certificates, mTLS and API Keys in ASP.NET Core

Service-to-service authentication in ASP.NET Core, measured on Kestrel and openssl with a throwaway test CA: the ClientCertificateMode values over TLS 1.2, TLS 1.3 and HTTP/2 (DelayCertificate renegotiation fails on macOS, throws on Linux TLS 1.3 over HTTP/1.1 and silently returns no certificate over HTTP/2), AddCertificate validation (system versus custom root trust, usage, expiry, revocation by CRL and OCSP failing closed), a certificate forwarded in a header and how to forge it and close it, the client-side certificate APIs, API keys with SHA-256 hashing, constant-time comparison and overlap rotation (203 ns per check, a naive comparison leaks the prefix length), and a certificate-bound token (RFC 8705, cnf x5t#S256).

6
ASP.NET Core

External Authorization with OpenFGA or OPA in ASP.NET Core

An external PDP (real OpenFGA and OPA in Docker) called from a resource-based AuthorizationHandler and an endpoint filter in ASP.NET Core, measured on .NET 10 with OpenFga.Sdk 0.10.5: latency per call (0.45 ms against 0.15 ms for a built-in handler), the N+1 problem on lists (one Check per item, BatchCheck capped at 50, ListObjects silently capped at 1000), decision caching and the stale decision after a revoke (a 5 s TTL, in both directions, plus OpenFGA's own query cache and HIGHER_CONSISTENCY), OPA bundles and decision logs, and what happens when the PDP is down or hung (fail-open against fail-closed, SDK retries, timeouts).

7
ASP.NET Core

SAML 2.0 Single Sign-On in ASP.NET Core

SAML 2.0 service provider in ASP.NET Core, measured against a real Keycloak 26.8.2 in Docker with Sustainsys.Saml2.AspNetCore2 2.11.1 on net10.0. ASP.NET Core has no native SAML (shared framework and Microsoft packages checked), and the library state checked on 2026-11-19 (Sustainsys in security-only mode with four advisories fixed in 2.11.1, ITfoxtec active with net10 and net11 targets, Duende IdentityServer 8 SAML docs only). The AuthnRequest over the Redirect and POST bindings, the signed Response and Assertion decoded, SP and IdP metadata, attribute-to-claim mapping and the cookie session (7 role attributes, a 4017 byte chunked cookie, a 500 from ForbidAsync), and the attacks measured: tampered, unsigned and wrongly signed assertions, XML Signature Wrapping (a naive verifier is fooled, the library rejects), Audience, InResponseTo, the default 5 minute clock skew, replay (the cache is in memory and forgets on restart) and Single Logout (SP-initiated works, IdP back-channel logout does not end the app session).

8
ASP.NET Core

Windows Authentication in .NET: Negotiate, Kerberos and LDAP

Integrated authentication in ASP.NET Core 10 with Microsoft.AspNetCore.Authentication.Negotiate 10.0.15, measured against a real MIT Kerberos KDC and a real OpenLDAP in Docker (SDK 10.0.100, run on Ubuntu 24.04 with runtime 10.0.14). The 401 Negotiate challenge and the mutual-auth token, connection state (Kerberos is not kept per connection by default, NTLM is; PersistKerberosCredentials on and off), HTTP/2 and proxies, and the failures as client and server see them (no ticket, SPN by IP or alias, clock skew of 4 and 6 minutes, keytab without the key, a rotated key version, a missing keytab, all 500 by default and how to turn them into 401). NTLM on Linux needs gss-ntlmssp and a validator, and the user name changes spelling. Roles from EnableLdap on Linux (nested groups, 10 minute cache, MachineAccountName unsupported, no reconnect and a SIGSEGV after an LDAP restart, a 500 for a user without memberOf) and the handler's own LDAP injection fixed in 10.0.10 (CVE-2026-47303 and two more advisories), shown with principals such as bo* on 10.0.9 against 10.0.15. LDAP directly with System.DirectoryServices.Protocols: simple, anonymous and empty-password binds, SASL GSSAPI, LDAPS and StartTLS quirks on Linux, paging against a server-side total limit, and filter escaping (the library has none). System.DirectoryServices.AccountManagement is Windows-only (build and run shown). IIS, HTTP.sys and Kerberos delegation are docs only. Kerberos against OIDC and SAML.

Resilience & Protection

Caching & Performance

Observability

1
ASP.NET Core

OpenTelemetry: Logs, Metrics and Traces

ILogger, Meter and ActivitySource as the three framework APIs, what ASP.NET Core already emits on its own, what the SDK and the instrumentation packages add, context propagation, metric cardinality limits, histogram buckets, sampling, resources the path the OTLP exporter really posts to and the .NET 11 tracing rules for Activity (AddTracing, no manual ActivityListener), with the measured result of each experiment.

2
ASP.NET Core

ILogger: Categories, Levels, Filtering and Scopes

ILogger<T> and ILoggerFactory categories, log levels, the rule that picks one filter per provider and category, per-provider sections, AddFilter, EventId, message templates versus interpolation and CA2254, scopes, source-generated [LoggerMessage] logging and redaction of classified data, with the measured result of each experiment.

3
ASP.NET Core🔬 Lab

Structured Logging with Serilog and Log Sinks

Serilog behind ILogger in ASP.NET Core, run on .NET 10: message templates against interpolation, destructuring with masking, UseSerilog and the bootstrap logger, Console JSON and rolling File sinks configured in appsettings, LogContext, scopes and enrichers, request logging, redaction of sensitive data, an in-memory sink for tests, and Serilog against OpenTelemetry Logs.

4
ASP.NET Core

Observability Backends: Prometheus, Grafana, Tempo and Application Insights

Where OpenTelemetry signals go and how to query them, measured on Docker with two ASP.NET Core services: the Collector as the single endpoint (OTLP over gRPC and HTTP), Prometheus with PromQL and the effect of an exploding tag on series, Tempo traces, Loki logs with trace_id, Grafana datasources provisioned by file and checked through the API, head sampling in the SDK against tail sampling in the Collector, and Application Insights from the docs only.

Operations

Real-Time

Remote APIs

1
ASP.NET Core

gRPC Services and JSON Transcoding

gRPC in ASP.NET Core 10 with measured results: .proto contracts and generated code, the HTTP/2 requirement (h2c, HTTP_1_1_REQUIRED, 426 on HTTP/1.1), channel reuse, the four call types, deadlines and cancellation, status codes and rich errors, metadata, interceptors, contract evolution, protobuf vs JSON sizes, JSON transcoding and its streaming limits, and when to choose gRPC, REST or transcoding.

2
ASP.NET Core🔬 Lab

Reverse Proxy and API Gateway with YARP

A YARP gateway in front of two real Kestrel backends, measured end to end: routes and clusters, transforms, six load balancing policies, passive and active health checks, rate limiting and authentication at the edge, timeouts and status codes, hot reload, gateway versus BFF, and YARP against managed gateways, Ocelot and Envoy, all run on .NET 10.

3
ASP.NET Core

GraphQL with Hot Chocolate

A Hot Chocolate 16.7.6 server on net10.0 measured end to end: code-first schema with source generators, the N+1 problem counted in SQL statements with 1, 10 and 100 parents (7, 61 and 601 against a flat 3 with DataLoader), filtering, sorting and projection as SQL, cursor connections against offset on 200,000 rows, subscriptions over WebSocket and SSE, depth and cost limits (and how an unannotated list hides a 51,010 cost behind a 30), introspection, persisted operations, partial errors against HTTP status, authorization, GraphQL against Minimal APIs in bytes and requests, and the project's maintenance state and licensing.

Web API Design

Cloud-Native

Globalization

Blazor Fundamentals

Components & Forms

1
Blazor🔬 Lab

Blazor Component Lifecycle and Parameters

Which lifecycle hooks run in the prerender and in the interactive instance, when OnParametersSet fires, EventCallback versus a delegate, StateHasChanged and the dispatcher, cascading values and @key, measured with logs.

2
Blazor🔬 Lab

Blazor Data Access and Streaming Rendering

Why a DbContext injected into an interactive component lives as long as the circuit, IDbContextFactory, the duplicate query from prerendering and PersistentState, and why WebAssembly needs an API.

3
Blazor🔬 Lab

Blazor Forms: EditForm and Validation

Model, EditContext and DataAnnotationsValidator, when each rule fires, nested object and collection validation in .NET 10, server-side errors with ValidationMessageStore, InputBase<T>, and the link to minimal API validation.

4
Blazor

Blazor WebAssembly Client and API Integration

A standalone WebAssembly client calling an API on another origin, observed in a browser: CORS from both sides, the base address trap, named clients, download size with trimming, compression and invariant globalization, and lazy loading.

5
Blazor🔬 Lab

Blazor QuickGrid and Virtualize

QuickGrid with sorting and paging over an IQueryable and over an ItemsProvider, page and sort kept in the URL in .NET 11 (headers and pager as links), Virtualize with ItemsProvider, ItemComparer and the BL0011 warning, tested with WebApplicationFactory and bUnit 2.15.2.

Data Access Choices

EF Core

1
Data Access

DbContext Lifetime and Change Tracking

One context per unit of work, pooling and IDbContextFactory, the entity states in the change tracker, and when AsNoTracking pays off.

2
Data Access🔬 Lab

EF Core CRUD Operations and Seeding

Model, DbContext, and SQLite registration, Add vs SaveChanges, FindAsync and projection, set-based update and delete, and seeding reference data with UseSeeding and HasData.

3
Data Access

Loading Related Data and the N+1 Problem

Include and ThenInclude, cartesian explosion and AsSplitQuery, N+1 through lazy loading, projections, and reading the generated SQL with ToQueryString.

4
Data Access

Query Translation and Performance in EF Core

Where LINQ to SQL translation stops, compiled queries, ExecuteUpdate and ExecuteDelete, FromSql vs FromSqlRaw, and keyset pagination.

5
Data Access

Transactions and Optimistic Concurrency in EF Core

The implicit transaction in SaveChanges, concurrency tokens (rowversion and xmin), DbUpdateConcurrencyException, and a retry strategy combined with a manual transaction.

6
Data Access

Explicit Transactions, Savepoints and TransactionScope

Explicit transaction control in EF Core 10 measured on SQLite and PostgreSQL: BeginTransaction across several SaveChanges, AutoTransactionBehavior in the log, the savepoint EF creates by itself, sharing a transaction with ADO.NET, the retrying execution strategy, isolation levels with two connections and a 40001 retry, SQLite isolation, TransactionScope and async flow, prepared transactions with two connections, and lock waits.

7
Data Access

Multi-Tenancy: Discriminator vs Database per Tenant

Multi-tenant data access with EF Core 10, measured: a tenant filter bound to the context instance, filters that freeze the first tenant, writes the filter does not guard, unique indexes with TenantId, PostgreSQL row-level security and who bypasses it, database per tenant with factories and pooling, schema per tenant with IModelCacheKeyFactory, and what migrations do in each model.

EF Core Modeling

1
Data Access🔬 Lab

EF Core Model Building: Conventions, Annotations and Fluent API

Which of convention, data annotation and Fluent API wins (checked on the real model and migration), defaults with ConfigureConventions versus a finalizing convention, IEntityTypeConfiguration, HasData in the migration, and compiled models.

2
Data Access🔬 Lab

Relationships, Keys and Delete Behavior

Required versus optional and the ON DELETE each produces, what SaveChanges does with loaded and unloaded dependents (checked in the SQLite SQL), orphans, composite and alternate keys, shadow foreign keys and many-to-many with skip navigations.

3
Data Access

Join Pruning and Foreign Keys Without Constraints in EF Core 11

EF Core 11 removes joins whose columns are never used, trusting the model to do it. ExcludeForeignKeyFromMigrations against IsConstrained(false), and a SQLite run with an orphan row where the same table answers 2 or 1 rows depending on the query. EF Core 10 against 11 with offline SQL.

4
Data Access🔬 Lab

Generated Values, Defaults and Computed Columns

HasDefaultValue, HasDefaultValueSql, computed columns and ValueGeneratedOn* with the real EF Core 10 INSERT and UPDATE on SQLite, the sentinel value trap, triggers versus RETURNING, and the SQL Server DDL with a sequence and a named default.

5
Data Access

Inheritance Mapping: TPH, TPT and TPC

The three EF Core 10 inheritance strategies with the real schema and SQL on SQLite: the undeclared derived type that silently loses data, discriminators and shared columns, TPT joins, TPC unions, keys and missing foreign keys, and how to choose.

6
Data Access🔬 Lab

Reverse-Engineering an Existing Database

dotnet ef dbcontext scaffold on EF Core 10 against a legacy SQLite schema: what it generates for keys, defaults, join tables, views and keyless tables, the options that matter, re-scaffolding with partial classes and OnModelCreatingPartial, and customizing the T4 templates.

7
Data Access

Value Converters, Comparers and Strongly-Typed Ids

Built-in and custom value converters in EF Core 10, ConfigureConventions per type, why null never reaches a converter, what translates and what fails in queries on converted members, the ValueComparer that keeps in-place edits from being lost, key comparers, strongly-typed ids from the column to the Minimal API route, the cost per row, and when a complex type, owned type or entity fits better, with the measured result of each experiment.

8
Data Access🔬 Lab

JSON Columns and Complex Types

ToJson on complex and owned types, collections in one JSON column, the real SQL generated to query and update inside the document (checked on SQLite), what does not translate, ExecuteUpdate over JSON, and what EF Core 10 changed.

9
Data Access

EF Core Provider Differences: PostgreSQL, SQL Server and SQLite

One EF Core model measured on EF Core 10 and rerun on EF Core 11 GA against PostgreSQL 18 and SQLite, with SQL Server from the docs: case sensitivity and collations (ICU nondeterministic, citext, NOCASE), DateTime and DateTimeOffset rules, decimal storage and precision, identity, GUID generation and batching, ALTER COLUMN versus table rebuild, arrays, JSON and enums, concurrency tokens, and why tests on SQLite miss production bugs.

10
Data Access

Temporal Tables and History Queries in EF Core

IsTemporal, TemporalAsOf, TemporalAll, TemporalBetween and the other operators, the DDL and SQL EF Core 11 generates (offline, no server), converting an existing table, restoring a deleted row and period columns as CLR properties, new in EF Core 11. A SQL Server feature, not run against a server.

EF Core Querying

1
Data Access🔬 Lab

EF Core Logging, Query Tags and Diagnostics

ToQueryString, LogTo and ILogger by category, sensitive data and detailed errors, TagWith and interceptors that count commands.

2
Data Access🔬 Lab

Global and Named Query Filters (EF Core 10)

HasQueryFilter for soft delete and multi-tenancy, EF Core 10 named filters with selective IgnoreQueryFilters, and the required-navigation trap.

3
Data Access

Raw SQL, Unmapped Types and Views

SqlQuery<T> for types outside the model, ExecuteSql, and keyless entities for views and defining queries on EF Core 10, with the real SQL on SQLite: the Value alias, filters that SqlQuery skips, silent extra columns, and the ToSqlQuery mapping that still creates a table.

4
Data Access

EF.Functions and Database-Specific Translation

How a .NET method becomes SQL, LIKE, Collate and Random run on SQLite with the real SQL, wildcards in user input, Single versus First, provider-specific functions, and mapping your own database function.

5
Data Access

SQL Server 2025 JSON Queries: JSON_CONTAINS and JSON_PATH_EXISTS in EF Core 11

When Contains over a JSON collection becomes JSON_CONTAINS (compatibility level 170) and when it stays OPENJSON, EF.Functions.JsonContains (experimental, EF9106) and JsonPathExists, with the table of variations that decides the parameter case. SQL generated offline, no server.

6
Data Access

Full-Text Search with EF Core: SQL Server, PostgreSQL and SQLite

When LIKE '%x%' stops being enough. Full-text catalog and index in the model (EF Core 11), FreeText and Contains, FreeTextTable and ContainsTable with a rank, tsvector and GIN on PostgreSQL (run on Npgsql 11.0.0 and PostgreSQL 18.7), and SQLite FTS5 actually run, with bm25, triggers and the user input that breaks MATCH.

7
Data Access

Vector Search with EF Core 11 and SQL Server 2025: Exact, Approximate and Hybrid

SqlVector<float> columns, CREATE VECTOR INDEX from migrations, VectorDistance for exact search, VectorSearch().Take().WithApproximate() for the index, the warning for forgetting it, the T-SQL EF Core 11 generates, hybrid search with full-text and FullJoin, and the vector column no longer loaded with the entity. Offline SQL, not run against a server.

8
Data Access

EF Core Interceptors, Events and Auditing

The EF Core 10 interceptor families and the order of their hooks, registration versus DI lifetimes, the sync hook that never calls the async one, short-circuiting with InterceptionResult, a same-transaction audit and soft-delete interceptor and what bypasses it, a slow-query log and a tenant id for row-level security on PostgreSQL, the .NET events and the cost of an interceptor, with the measured result of each experiment.

9
Data Access🔬 Lab

EF Core Compiled Models and Startup Time

dotnet ef dbcontext optimize, what the compiled model generates and how EF Core finds it, what changes in EF Core 11 (EFOptimizeContext removed), startup measured with and without a compiled model on 60 and 300 entities, the stale model nobody notices, and precompiled queries, still experimental.

Migrations

Application Architecture

Modular Architecture

DDD

Distributed Actors

Background Jobs

1
Concurrency & Background Work

Hosted Services and BackgroundService

IHostedService vs BackgroundService, unhandled exceptions that stop the host, scoped services through IServiceScopeFactory, PeriodicTimer, and graceful shutdown.

2
Concurrency & Background Work

In-Memory Queues with Channels

Bounded Channel<T>, BoundedChannelFullMode, an endpoint as producer and a BackgroundService as consumer, and what a restart loses.

3
Concurrency & Background Work

Durable Jobs with Hangfire and Quartz.NET

Persistent job storage, retries, idempotency under at-least-once delivery, recurring jobs, and passing IDs instead of entities.

4
Concurrency & Background Work🔬 Lab

Transactional Outbox, Inbox and Idempotent Consumers

The outbox row written in the same EF Core transaction, a BackgroundService relay with retries, backoff and dead-letter, an inbox with a deduplication key, idempotent consumers and at-least-once delivery, and what happens in each failure, every case driven by a fault-injecting test.

5
Concurrency & Background Work🔬 Lab

Message Brokers: MassTransit, Azure Service Bus and RabbitMQ

Queues, topics, competing consumers, at-least-once and dead-letter, MassTransit on the in-memory transport and test harness (publish versus send, retry and fault, an inbox check, the consumer outbox), what changes with RabbitMQ and Azure Service Bus, the MassTransit v9 commercial license (the lab pins the Apache-2.0 8.5.12) and alternatives.

Concurrency

1
Concurrency & Background Work

Task and async/await Internals

The compiler state machine, SynchronizationContext and ConfigureAwait, deadlocks with .Result, async void, and the rules of ValueTask.

2
Concurrency & Background Work

Data Parallelism: Parallel and PLINQ

CPU-bound vs I/O-bound work, Parallel.ForEachAsync, PLINQ, localInit and localFinally, and when parallel code gets slower.

3
Concurrency & Background Work

Coordinating Concurrent Work

Cancellation and timeouts, throttling with SemaphoreSlim, fan-out and fan-in with Channels, TaskCompletionSource, and ConcurrentDictionary.GetOrAdd pitfalls.

4
Concurrency & Background Work

Redis with StackExchange.Redis: Structures, Pub/Sub and Locks

Redis measured from C# in Docker: one multiplexer against one per call, a server dying mid-traffic, a transaction without rollback, Pub/Sub against Streams with the consumer down, a sorted-set rate limiter, eviction deleting a lock, a distributed lock whose holder pauses past the TTL and the fencing token that refuses the stale write, the Redlock debate, stampede, and the Redis, Valkey and Garnet licences.

5
Concurrency & Background Work🔬 Lab

Runtime Async in .NET 11

What changes when the runtime, not the compiler, suspends async methods: how to opt in (still documented as preview for your own code), what the BCL already does, live stack depth, allocation and time measured in Release, and what stays the same for ConfigureAwait, ValueTask, AsyncLocal and exception traces.

What's New & Migration

1
Platform & Tooling

What's New in .NET 10: A Map of the Platform

A hub for the .NET 10 LTS release: what the official runtime, SDK and libraries pages list (JIT and stack allocation, file-based apps, one-shot tools, package pruning, numeric ordering, JSON options, async ZIP), each linked to the concept that explains it.

2
Platform & Tooling

What's New in .NET 11: A Map of the Platform

A hub for the .NET 11 release (STS) run on the 11.0.100 SDK: runtime, SDK and CLI, base library, what the 11 runtime changes even for a net10.0 app, and one pointer each to the C# 15, ASP.NET Core 11 and EF Core 11 maps, with what is still preview or doc only marked.

3
Platform & Tooling🔬 Lab

Upgrading to .NET 11 and Reading the Breaking Changes

How to read the breaking changes page and the real 10 to 11 case, with before and after run on SDK 10 and SDK 11: silent numeric, ZIP, GZip and args[0] changes, the Native AOT publish default at GA, and the compiler breaks CS7083, CS8352, CS9380 and with(...) versus @with.

4
ASP.NET Core

What's New in ASP.NET Core 10: A Map

A map of the ASP.NET Core 10 release notes grouped by hosting, Minimal APIs, OpenAPI, Blazor and Identity, separating automatic, opt-in and breaking changes, with a link to the concept that goes deep on each one.

5
ASP.NET Core

What's New in ASP.NET Core 11: A Map

A map of the ASP.NET Core 11 release notes grouped into automatic, opt-in, breaking and experimental changes, saying which items were run on the 11.0.100 GA and which come only from the official page, with a link to the concept that goes deep on each one.

6
ASP.NET Core

Migrating from ASP.NET Core 10 to 11

An upgrade checklist from the .NET 10 LTS, with before and after run on both SDKs: the NU1605 restore error from Microsoft.OpenApi 3.x, the OpenAPI 3.2 default, RunAsync throwing when a BackgroundService fails, scope disposal aggregating exceptions, an empty string winning in chained configuration and the automatic CSRF check, plus what comes only from the migration guide.

7
Data Access

What's New in EF Core 10: A Map

A map of the EF Core 10 release (LTS, .NET 10): complex types and JSON, ExecuteUpdate, named query filters, parameterized collections, LeftJoin, security, SQL Server and Cosmos DB, each pointing to the concept that goes deep.

8
Data Access

What's New in EF Core 11: A Map

A map of the EF Core 11 release (STS, .NET 11) with real SQL side by side against EF Core 10: leaner SQL, new translations, JSON path indexes, LastMigrationId, SQL Server 2025 and Cosmos DB.