Steven Giesel 6/29/2023

LINQ: Select.Where or Where.Select?

Read Original

This technical article analyzes the performance implications of chaining LINQ methods in C#, specifically comparing the order of Where and Select. It explains that filtering data with Where before projecting with Select is generally more efficient, as it reduces object allocations, especially for large datasets. The focus is on in-memory LINQ queries, providing a clear rule of thumb for writing optimized and readable code.

LINQ: Select.Where or Where.Select?

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week