Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query: Translation of ToList().Count does not work in all cases #19060

Closed
smitpatel opened this issue Nov 25, 2019 · 2 comments · Fixed by #19436
Closed

Query: Translation of ToList().Count does not work in all cases #19060

smitpatel opened this issue Nov 25, 2019 · 2 comments · Fixed by #19436
Assignees
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@smitpatel
Copy link
Contributor

We have code to convert such member access to Count() query.
For case like #9751 adding ToList in projection and then doing Where with Count fails with client eval error.

@smitpatel
Copy link
Contributor Author

Also check ToList().Count()

@ajcvickers ajcvickers added this to the 5.0.0 milestone Dec 2, 2019
smitpatel added a commit that referenced this issue Dec 20, 2019
smitpatel added a commit that referenced this issue Dec 27, 2019
smitpatel added a commit that referenced this issue Dec 31, 2019
…/ToArray/AsEnumerable

- Convert all enumerable methods to queryable unless specified on query parameter (coming from closure)
- Convert ICollection<T>.Count to Queryable.Count<T>()
- Simplify (Queryable/CollectionNav/OwnedCollectionNav).(ToList/ToArray/AsEnumerable).AsQueryable to underlying queryable
- Remove MaterializeCollectionNavigation when ToList/ToArray is called on collection navigation.
- Convert Array.Length to Queryable.Count<T>()

Resolves #19059
Resolves #19060
smitpatel added a commit that referenced this issue Dec 31, 2019
…/ToArray/AsEnumerable

- Convert all enumerable methods to queryable unless specified on query parameter (coming from closure)
- Convert ICollection<T>.Count to Queryable.Count<T>()
- Simplify (Queryable/CollectionNav/OwnedCollectionNav).(ToList/ToArray/AsEnumerable).AsQueryable to underlying queryable
- Remove MaterializeCollectionNavigation when ToList/ToArray is called on collection navigation.
- Convert Array.Length to Queryable.Count<T>()

Resolves #19059
Resolves #19060
@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Dec 31, 2019
@smitpatel
Copy link
Contributor Author

Also add ToArray().Length when specified on Queryable/Collection navigation.

smitpatel added a commit that referenced this issue Jan 1, 2020
…/ToArray/AsEnumerable

- Convert all enumerable methods to queryable unless specified on query parameter (coming from closure)
- Convert ICollection<T>.Count to Queryable.Count<T>()
- Simplify (Queryable/CollectionNav/OwnedCollectionNav).(ToList/ToArray/AsEnumerable).AsQueryable to underlying queryable
- Remove MaterializeCollectionNavigation when ToList/ToArray is called on collection navigation.
- Convert Array.Length to Queryable.Count<T>()

Resolves #19059
Resolves #19060
smitpatel added a commit that referenced this issue Jan 1, 2020
…/ToArray/AsEnumerable

- Convert all enumerable methods to queryable unless specified on query parameter (coming from closure)
- Convert ICollection<T>.Count to Queryable.Count<T>()
- Simplify (Queryable/CollectionNav/OwnedCollectionNav).(ToList/ToArray/AsEnumerable).AsQueryable to underlying queryable
- Remove MaterializeCollectionNavigation when ToList/ToArray is called on collection navigation.
- Convert Array.Length to Queryable.Count<T>()

Resolves #19059
Resolves #19060
smitpatel added a commit that referenced this issue Jan 1, 2020
…/ToArray/AsEnumerable

- Convert all enumerable methods to queryable unless specified on query parameter (coming from closure)
- Convert ICollection<T>.Count to Queryable.Count<T>()
- Simplify (Queryable/CollectionNav/OwnedCollectionNav).(ToList/ToArray/AsEnumerable).AsQueryable to underlying queryable
- Remove MaterializeCollectionNavigation when ToList/ToArray is called on collection navigation.
- Convert Array.Length to Queryable.Count<T>()

Resolves #19059
Resolves #19060
smitpatel added a commit that referenced this issue Jan 1, 2020
…/ToArray/AsEnumerable

- Convert all enumerable methods to queryable unless specified on query parameter (coming from closure)
- Convert ICollection<T>.Count to Queryable.Count<T>()
- Simplify (Queryable/CollectionNav/OwnedCollectionNav).(ToList/ToArray/AsEnumerable).AsQueryable to underlying queryable
- Remove MaterializeCollectionNavigation when ToList/Enumerable.ToArray is called on collection navigation.
- Convert Array.Length to Queryable.Count<T>()

Resolves #19059
Resolves #19060
smitpatel added a commit that referenced this issue Jan 1, 2020
…/ToArray/AsEnumerable

- Convert all enumerable methods to queryable unless specified on query parameter (coming from closure)
- Convert ICollection<T>.Count to Queryable.Count<T>()
- Simplify (Queryable/CollectionNav/OwnedCollectionNav).(ToList/ToArray/AsEnumerable).AsQueryable to underlying queryable
- Remove MaterializeCollectionNavigation when ToList/Enumerable.ToArray is called on collection navigation.
- Convert Array.Length to Queryable.Count<T>()

Resolves #19059
Resolves #19060
@ajcvickers ajcvickers modified the milestones: 5.0.0, 5.0.0-preview1 Mar 13, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0-preview1, 5.0.0 Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants