Benchmarks a CreateDeviceRequest DTO validated with DataAnnotations like Required and Range across identical .NET 8 and .NET 10 Web APIs using BenchmarkDotNet and HttpClient, showing how .NET 10's reflection-free validation metadata cuts request latency by roughly 3x on invalid payloads. ...
Compares a .NET 8 minimal API against a .NET 10 minimal API using BenchmarkDotNet, showing how static lambda route handlers eliminate closure allocations and how AllowOutOfOrderMetadataProperties speeds up JSON deserialization to cut a /weather endpoint's response time and GC pressure. ...
Benchmarks EF Core 8 against EF Core 10 by querying a PostgreSQL Users table seeded with 200,000 rows through an AsNoTracking().Where().Select() minimal API endpoint, measuring a 25-50% speed boost in production data fetching from JIT inlining and row materialization improvements. ...
Benchmarks parsing a JSON log entry's deviceId field with Newtonsoft.Json, System.Text.Json's JsonDocument, and the span-based Utf8JsonReader across .NET 8 and .NET 10 using BenchmarkDotNet, measuring 38% faster execution and lower allocations for high-volume log aggregation jobs. ...
Refactors an if-else DiscountService that hardcodes Regular (5%) and VIP (20%) discount math into an IDiscountStrategy interface with separate strategy classes, then wires the right strategy into ASP.NET Core's DI container so adding a new membership tier needs no changes to existing code. ...
Uses a PostgreSQL-backed EF Core console app with a Movie entity and a Budget owned entity holding ProductionCost, MarketingCost, and DistributionCost to show how owned types get stored as prefixed columns in the parent table without their own primary key, DbSet, or independent lifecycle. ...
Compares fetching a PostgreSQL Movie/Director schema with and without EF Core projections, showing how loading full entities with every column and navigation property triggers extra change tracking, slower deserialization, and N+1 query risk versus selecting only the fields a view actually needs. ...
Builds the same Product/Quantity/Price Excel report three ways in C# with the low-level DocumentFormat.OpenXml SDK's SpreadsheetDocument and WorkbookPart classes, then EPPlus, then ClosedXML, contrasting OpenXML's verbose cell-by-cell XML construction against the other libraries' higher-level APIs. ...
Compares DDD's Repository pattern against the Specification pattern using a Building aggregate root with nested Floor and Location child entities, showing how encapsulating query logic in reusable Specification objects scales better than adding new repository methods each time query needs grow. ...