How can I optimize performance in a .NET 8 Web API when using Entity Framework Core with complex queries?

Eng. Feras Musallam 20 Reputation points
2025-03-26T15:45:42.05+00:00

I'm building a .NET 8 Web API using ASP.NET Core and Entity Framework Core 8 with SQL Server. I'm running into performance issues when retrieving data that involves multiple related tables (e.g., nested includes, projections, and filtering on joins).

I want to:

Improve response time without sacrificing maintainability

Minimize memory usage during data retrieval

Explore patterns or libraries (e.g., Dapper, compiled queries, CQRS) if EF Core can't handle it efficiently

0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.