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. ...
Explains the .NET Garbage Collector's mark, relocate, and compact phases on the managed heap and its Gen 0/1/2 generational model, showing why short-lived objects like loop variables are reclaimed cheaply in Gen 0 while longer-lived objects get promoted to slower, less frequent collections. ...
Uses BenchmarkDotNet with MemoryDiagnoser to measure boxing a plain int into object, unboxing it back, and comparing both against an unboxed baseline, then extends the test to ArrayList versus List<int> to quantify how boxing's hidden heap allocations and GC pressure outweigh simple stack usage. ...
Shows how to build and compile C# expression trees at runtime using ParameterExpression, ConstantExpression, and Expression.Lambda to generate a working Func<int,int> delegate, then extends the technique to filter a Building entity's properties dynamically based on user-chosen search conditions. ...
Demonstrates with runnable C# code why an exception thrown inside an async void method crashes the app instead of being caught by a surrounding try/catch, unlike async Task, then walks through the compiler-generated state machine and AsyncTaskMethodBuilder that make Task methods exception-safe. ...
Walks through installing LINQPad, created by Joe Albahari in 2007, connecting it to PostgreSQL and SQL Server databases, and using its interactive Database Explorer to drill into related tables like Albums and Tracks while inspecting the exact SQL generated behind an EF Core LINQ query. ...