Steven Giesel 11/4/2024

Be careful with ToListAsync and ToArrayAsync in Entity Framework Core

Read Original

This technical article details a known performance degradation in Entity Framework Core when using ToListAsync or ToArrayAsync to query tables containing large columns like NVARCHAR(MAX). It explains the bug, provides a code example of a paging method, and demonstrates the fix by switching to the synchronous ToList() method within an otherwise async context for significant speed improvements.

Be careful with ToListAsync and ToArrayAsync in Entity Framework Core

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week