Collection Expression Arguments in C# 15 are "out"
Explains the new 'with' operator syntax for passing arguments to collection expressions in the C# 15 preview.
Steven Giesel is a Senior Software Engineer and Microsoft MVP with over 13 years of experience, specializing in .NET and modern backend development. He shares deep technical knowledge across topics such as C#, EF Core, RavenDB, distributed systems, and cloud-native architectures, and is an active speaker in the .NET community.
311 articles from this blog
Explains the new 'with' operator syntax for passing arguments to collection expressions in the C# 15 preview.
Updates to the .NET Toolbox, a free, open-source collection of client-side tools for .NET developers, including new features like an Options Generator and SRP Analyzer.
Using C# extension methods to solve nullability issues when modeling optional DTOs for partial entity updates.
Explores a C# proposal for adding arguments like capacity and comparers to collection expressions, potentially in C# 15+.
Introduces a free, open-source .NET Toolbox with utilities like JSON to C# conversion, middleware designer, and package centralizer for developers.
Explains why Task.Delay in C# fails for delays over 49.7 days and provides a workaround for long-running timers.
Analyzes performance differences between ToListAsync and ToArrayAsync in Entity Framework, concluding ToListAsync is faster.
Article explains why GitHub Actions runners are unreliable for benchmarking due to inconsistent hardware and performance variability.
Introduces the new MediaTypeMap helper in .NET 11 for easy MIME type and file extension lookups in web development.
How to implement sortable UUID v7 GUIDs as primary keys in Entity Framework using a custom value generator.
Explains that .NET 10 makes the Program class public by default, eliminating the need for 'public partial class Program' declarations in WebApplicationFactory tests.
Explains how to capture console output in xUnit.v3 tests using the new CaptureConsoleAttribute assembly-level attribute.
Analyzes common flaws in C# ArrayPool benchmarks, explaining how JIT optimizations can invalidate results and how to fix them.
Analyzes a LinkedIn post's claim about C# Random() being 'evil', explaining its evolution from .NET Framework to modern .NET's Xoshiro256** implementation.
Explores how inlining and structs in C# interact to optimize performance, focusing on method call overhead and struct copying.
Explains why and how to use CancellationTokens in .NET APIs to stop long-running operations and free server resources.
Analyzes C# performance benchmarks for slicing lists, comparing Skip/Take, Range operator, and GetRange methods, highlighting a common benchmarking error.
Explains how ToDictionaryAsync in Entity Framework Core retrieves entire database objects, impacting performance, and provides a solution using Select.
A developer shares techniques to improve database performance for large BLOB data retrieval in C#/.NET, including compression and chunking requests.
Explains the performance difference between C# collection expressions and collection initializers, showing how expressions preallocate lists.