Compares four ways to bulk insert an Order entity in EF Core: naive per-record Add plus SaveChangesAsync, DbSet.AddRangeAsync, the EFCore.BulkExtensions package's BulkInsertAsync for true batched inserts, and raw SQL, weighing each against change-tracker overhead and round-trip cost at scale. ...
Covers C# 13 on .NET 9: extending params beyond arrays to Span<T>, stack-allocated ReadOnlySpan<T>, and IEnumerable<T> collections, plus the new implicit index operator, a dedicated escape sequence, the System.Threading.Lock type, and optimized overload resolution, each with runnable code. ...
Implements Quartz.NET scheduling two ways: a console PrintJob firing every 5 seconds via IJob, StdSchedulerFactory, and WithSimpleSchedule().RepeatForever(), then an ASP.NET Core alarm job configured through appsettings.json using the Cron expression 0 0 7 * * ? to run automatically at 7 AM daily. ...
Contrasts C# 9.0 records against classes using a Student(Name, Age) example: records give value-based equality, so two identical Students compare equal, versus classes' reference equality, plus the with expression for non-destructive copies, then argues for records as concise, immutable API DTOs. ...
Walks through .NET 9's JsonSchemaExporter in System.Text.Json: calling GetJsonSchemaAsNode on a Student record to produce a JSON Schema document, then customizing output via JsonSerializerOptions with SnakeCaseLower naming, NumberHandling.WriteAsString, and JsonUnmappedMemberHandling.Disallow. ...
Shows .NET 9's two new LINQ methods replacing GroupBy chains on a Student(Name, Subject) list: CountBy collapses GroupBy().Select(Count) into one call, producing Java: 2, C#: 3, JavaScript: 1, while AggregateBy replaces GroupBy().Sum() to total each subject's Marks in a single seeded aggregation. ...
Demonstrates five C# 11 features with runnable examples: triple-quoted raw string literals for unescaped quotes, list pattern matching like values is [10, 20, 30, ..], UTF-8 string literals via the u8 suffix, required members enforcing FirstName and Email at object initialization, and generic math. ...
Covers two .NET 9 cryptography additions: CryptographicOperations.HashData for one-shot hashing by naming an algorithm like SHA256, and the new KMAC classes (Kmac128, Kmac256, KmacXof128/256) for message authentication, with a Kmac128.HashData example and its Linux OpenSSL 3.0/Win11 requirements. ...
Presents five ASP.NET Core extension-method patterns: an IServiceCollection.InjectedServices method that consolidates dozens of DI registrations out of Program.cs, a string.IsValidEmail() validator built on MailAddress, and a ClaimsPrincipal.IsOneOf(params string[] roles) helper for role checks. ...