linq: Select.Where or Where.Select #68
Replies: 2 comments 9 replies
-
|
Hi, |
Beta Was this translation helpful? Give feedback.
-
|
I'm not sure, but won't a pass through the collection, even with multiple where, be performed once? As long as we don't call one of the To methods, that collection may not be counted at all, and none of the where methods will be called at all, otherwise there will be one crawl through the original collection regardless of how many times where and select were called, as well as their order. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
linq: Select.Where or Where.Select
LINQ is a very powerful tool for querying data. As the majority of functions are built on top of IEnumerable and it, in most cases returns IEnumerable as well, it is very easy to chain multiple functions together. That leaves you with a question: which one should I use, Select.Where or Where.Select?
https://steven-giesel.com/blogPost/57ed9867-4afd-4d02-9f35-e0941bc6f715?utm_source=csharpdigest&utm_medium=&utm_campaign=1674
Beta Was this translation helpful? Give feedback.
All reactions