That the .NET Core ecosystem brings the Language-Integrated Query (LINQ) of C# and Entity Framework Core provides a lot of comfort.

One property of LINQ is that it defers execution of queries, if the return value of the query is a sequence of values. This provides for flexibility in composing complex queries programatically without changing the way you compose the query.

There are some pitfalls of deferred execution, for instance it can cause degraded performance due to potential multiple enumeration. I learned of another one that caught me by surprise: If the execution is deferred long enough, resources that are needed for querying may be disposed of.

Searching the internet for “The operation cannot be completed because the DbContext has been disposed.” returns more than enough results, here is one StackOverflow answer that I found useful.