Traces what EF Core's ChangeTracker does with a Student/Enrollment model: context.Add marks new entities Added and assigns temporary keys, SaveChanges emits INSERTs in dependency order and backfills the real StudentId foreign key, versus attaching an Enrollment to an already-tracked Student. ...
Goes beyond Singleton/Scoped/Transient basics with concrete .NET DI patterns: resolving services manually in an MqttListener via IServiceProvider versus IServiceScopeFactory for scoped lifetimes, injecting IEnumerable to get every registered implementation, and registering variants via AddKeyed. ...
Speeds up EF Core queries on a Building/Floor model: projecting only needed columns into a DTO, disabling tracking per-query with AsNoTracking or globally via HasQueryTrackingBehavior, choosing lazy loading with Microsoft.EntityFrameworkCore.Proxies versus eager loading, plus indexing/pagination. ...
Shows C# tuple syntax from Tuple<T> through named literal tuples (C# 7.0+), nested tuples, and deconstruction, then two real examples: passing a (Latitude, Longitude) tuple as a method parameter, and returning a (Subject, Body) tuple from an email-content generator keyed off an EmailTypeEnum. ...
Builds C# delegate intuition with a waiter/chef analogy, then two code examples: a multicast PrintMessage delegate chaining PrintToConsole and PrintToFile via +=, and a menu-driven console app mapping user choices to AddContact/ViewContact/DeleteContact through a Dictionary<string, PrintMessage>. ...
Demonstrates EF Core's complex type feature via a shared ContactInfo record (PhoneNumber, Email) reused across Customer, Employee, and Vendor entities, showing how EF Core flattens it into ContactInfo_PhoneNumber/ContactInfo_Email columns per table, then wiring it up with the Owned annotation. ...
Compares C# type declarations with side-by-side examples: a mutable Student class where s2 = s1 shares one reference so changing s2.Semester also changes s1.Semester, a Point struct where copies behave as independent value types, and C# 9.0's immutable records with built-in equality and hashing. ...
Builds a reusable GradientButton control in .NET MAUI step by step: scaffolding a ContentView in a controls folder under MVVM, swapping its default Label for a named Button, then exposing a bindable Text property via BindableProperty.Create so it binds from XAML like any built-in control. ...
Introduces BenchmarkDotNet for .NET performance testing: marking a SumNumbers method with [Benchmark], running it via BenchmarkRunner.Run in Release configuration, understanding its warmup and pilot-run process for JIT-optimized results, and parameterizing input sizes with [Params(10, 100, 1000)]. ...