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: Allow AsEnumerable in subquery #19059

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

Query: Allow AsEnumerable in subquery #19059

smitpatel opened this issue Nov 25, 2019 · 0 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-enhancement
Milestone

Comments

@smitpatel
Copy link
Member

According to #16314 Queryables/DbSet cannot be returned in anonymous projection due to type mismatch. Correct way to write it would be ToList/ToArray at the end of subquery. We could also allow AsEnumerable. (Internally we create list anyway)

@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 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-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants