terminal operator
A LINQ call such as ToList, First, Count or Sum that actually runs a deferred query and produces a result.
In more detail
It is the border crossing into memory: everything before it can be translated to SQL by EF Core, and everything after it runs in C#. Calling ToList too early fetches the whole table.
Related terms
- deferred execution — Building a query now but running it only when something asks for its results.
- IQueryable<T> — The .NET interface for a query that a provider such as EF Core translates and runs elsewhere, typically as SQL in a database.
- full table scan — A database reading every row of a table to answer a query, instead of using an index to jump to the rows it needs.
Taught in
- Collections, Generics, and LINQ — Modern .NET Core, C# & Enterprise Microservices
- Querying, Change Tracking, and Saving Data — Modern .NET Core, C# & Enterprise Microservices