Query execution

I’ve said that a query is kind of like a delegate, in that it is only executed when it’s triggered. Well, the detail is a little more complicated. (Isn’t it always?) Here are the rules:

Image Queries that return a singleton value are executed immediately. Examples of this kind of query are those that include the Average, Count or First expressions:

Image

Image Queries that return multiple values are executed when they’re iterated over. You’ll usually ...

Get Fluent Entity Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.