EF Core and LINQ — Know What Gets Translated
The sneaky LINQ performance trap in C# is mixing EF Core queryables with in-memory LINQ. If you call .ToList() too early, you pull the entire table into memory and filter it in C#. Use EF Core's async queryable methods and only materialize at the last step.