DEV Community

DotNet Full Stack Dev
DotNet Full Stack Dev

Posted on

πŸš€ Pro Tip: Leverage IEnumerable for Deferred Execution

Image description

πŸ“Œ Highlights:
❌ Immediate Execution: List forces execution of all items, even if you don't need them all at once.
βœ… Deferred Execution: IEnumerable allows for efficient, on-demand processing, improving performance for large datasets by delaying execution until iteration.

Top comments (1)

Collapse
 
wayneo profile image
Wayne Douglas

It's the .ToList that causes the execution?