Add EntityFrameworkQueryableExtensions.ToLookupAsync
See original GitHub issueWe already have ToDictionaryAsync, however when loading associations often what you want is a lookup which you would otherwise have to construct using two separate statements:
var childLookup = await context.ChildEntities
.Where(c => Enumerable.Contains(parentIds, c.ParentId))
.ToLookupAsync(c => c.ParentId);
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Implement ToLookupAsync · Issue #15916 · dotnet/efcore
We decided not to fix this since the implementation was converting queryable to enumerable and calling API on top of it (implementation was ......
Read more >EntityFrameworkQueryableExten...
Asynchronously creates a List<T> from an IQueryable<T> by enumerating it asynchronously.
Read more >EntityFrameworkQueryableExten...
Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jcracknell You are correct. I’ll bring it up again with the team.
Discussed with the team and we still feel this is better done without the additional copy.