Be careful with ToListAsync and ToArrayAsync in Entity Framework Core
Explains a performance issue with ToListAsync/ToArrayAsync in EF Core when querying large data columns and recommends using synchronous versions.
Steven Giesel is a Senior Software Engineer and Microsoft MVP with over 13 years of experience, specializing in .NET and modern backend development. He shares deep technical knowledge across topics such as C#, EF Core, RavenDB, distributed systems, and cloud-native architectures, and is an active speaker in the .NET community.
311 articles from this blog
Explains a performance issue with ToListAsync/ToArrayAsync in EF Core when querying large data columns and recommends using synchronous versions.
Performance comparison between ToArrayAsync and ToListAsync methods in Entity Framework 8, using benchmarks to analyze memory and speed.
Benchmarking performance of ASP.NET Minimal API vs classic Controllers in .NET 8 and 9 using BenchmarkDotNet.
Learn two Git tricks: quickly switch back to the previous branch and view the last 5 checked-out branches using reflog.
Explains how to use NuGet's Central Package Management feature to centrally manage package versions across multiple .NET projects.
Overview of xUnit v3 prerelease features, including executable test projects, migration steps, and new capabilities like cancellation tokens.
Explores alternatives to Swagger for API documentation in ASP.NET 9, including Swashbuckle, NSwag, and Scalar.
A guide to centralizing CancellationToken management in ASP.NET using a middleware service to reduce repetitive code.
A developer explains a compiler error when performing LINQ joins on multiple columns in Entity Framework and provides the solution requiring matching anonymous type property names.
A guide on mocking HttpClient calls in .NET API tests using DelegatingHandler and WebApplicationFactory for stable, controlled testing.
Discusses the pros and cons of soft deleting database records, including implementation, performance, and alternatives.
Explains how to use FormattableStringFactory in C# to create dynamic SQL queries safely with Entity Framework Core, preventing SQL injection.
The .NET team concludes its async2 experiment, exploring a new runtime-based implementation of async/await for improved efficiency and flexibility.
Explains how to use the AsParametersAttribute in ASP.NET Minimal APIs to organize endpoint parameters into cleaner, encapsulated DTOs.
Explores the massive and growing number of public APIs in the .NET ecosystem, analyzing counts across different versions of ASP.NET Core.
Explains how the C# compiler transforms async/await code into a state machine, detailing the process with a simplified example.
Analyzes a flawed LinkedIn benchmark on LINQ's 'let' keyword, explaining why the test doesn't measure real performance and how to benchmark correctly.
Explains the new UUID v7 (GUID) generation in .NET 9, highlighting its sortable timestamp structure and usage.
A guide on using GitHub Codespaces to simplify contributor onboarding for .NET open-source projects by setting up pre-configured cloud dev environments.
Introducing the new ReadOnlySet<T> type in .NET 9, explaining its purpose and advantages over existing interfaces and workarounds.