question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The entire data set is loaded into memory with ToListAsync() when executing the procedure

See original GitHub issue

When executing the procedure with SqlQueryAsync, the entire data set is asynchronously loaded into memory with ToListAsync(). Wouldn’t it be better to use AsAsyncEnumerable() on the IQueryable so that the data set can be asynchronously enumerated and return IAsyncEnumerable?

This would require having Microsoft.Bcl.AsyncInterfaces package installed on projects targeting netstandard 2.0 (for EFCore3)

Also, thanks for your hard work on this amazing tool, it’s a time saver.

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
superrnovaecommented, Apr 26, 2023

Interested in doing a PR?

I am.

0reactions
ErikEJcommented, Jul 22, 2023

Moving to backlog for now, will reconsider if more ask for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit Testing with Moq sometimes fails on ToListAsync()
I have experienced some issues with the In memory database. ... If it is a simple GetAll() method, do you really need to...
Read more >
Efficient Querying - EF Core
ToList();. Since the number of rows returned depends on actual data in your database, it's impossible to know how much data will be...
Read more >
Entity Framework performance improvement: [Section 3] ...
When performing multiple database operations in parallel, use Task.WhenAll() to execute them asynchronously. This allows all the operations to be executed ...
Read more >
In EF Core every foreach is a potential runtime error that ...
ToList() disables data streaming and put all data into the memory. ... E) Rewrite the first method to not make any (ANY) database...
Read more >
Optimizing Entity Framework Core Database Queries With ...
When a method call allocates more memory than the specified threshold, DPA will mark it as a potential issue in the editor: Similarly,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found