Iterator Pattern Best Practices in C#: Code Organization and Maintainability
Explore iterator pattern best practices in C# including yield return patterns, lazy evaluation, disposal, thread safety, and performant custom iterators.
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.
Explore iterator pattern best practices in C# including yield return patterns, lazy evaluation, disposal, thread safety, and performant custom iterators.
This week digs into building ASP.NET Core Web APIs: controllers, minimal APIs, model validation, error handling, versioning, and JWT auth. Plus a full run through the iterator, mediator, and chain of responsibility patterns in C#, with new videos on engineering careers, testing, and single points of failure.
Learn asp.net core model validation with data annotations, custom attributes, IValidatableObject, and FluentValidation for robust, testable input handling.
Master the mediator design pattern in C# with code examples, real-world scenarios, and best practices for reducing object coupling.
Go deeper into the core topics on Dev Leader, from .NET and AI to software engineering and career growth.