LINQ Deferred Execution in C#: When Queries Execute and Multiple Enumeration Pitfalls
Understand LINQ deferred execution in C# -- when queries actually run, multiple enumeration bugs, and when to materialize with ToList for correctness.
C# and .NET by Nick Cosentino
Practical, in-depth content for software engineers and technical leaders. Learn C#, .NET, software architecture, AI-assisted development, and engineering leadership with guidance you can apply on your team today.

The latest articles on software engineering, architecture, AI, and career growth.
Understand LINQ deferred execution in C# -- when queries actually run, multiple enumeration bugs, and when to materialize with ToList for correctness.
Learn how to implement the proxy pattern in C# with step-by-step examples covering virtual proxies, protection proxies, and DI registration.
Learn LINQ joins in C# from inner joins to the new .NET 10 LeftJoin and RightJoin, with real-world Customer/Order examples and SQL comparisons.
Master flyweight pattern best practices in C# including thread-safe factories, immutable shared state, memory monitoring, and avoiding common anti-patterns.
Go deeper into the core topics on Dev Leader, from .NET and AI to software engineering and career growth.