Linq: Skip(0) & Take(0) #47844
-
I notice that Queryable will still continue to create new query when Skip(0)/Take(0) is called. |
Beta Was this translation helpful? Give feedback.
Answered by
TonyValenti
Feb 19, 2021
Replies: 1 comment 3 replies
-
Queryable passes the expression as-is to the provider and let the provider to decide about optimization. It shouldn't try to optimize any thing. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I can see the advantage of optimizing out those two items. Ideally, a take(0) query should never even touch a database or collection.
I kind of think that a take(0) should return enumerable.empty or whatever the queryable equivalent is.