Entity SQL syntax

As I’ve said, the syntax of Entity SQL is almost identical to standard SQL. It supports all the clauses you’d expect, including FROM, WHERE, JOIN, and ORDER BY. (For a complete list, check MSDN for “Entity SQL Reference”.) But there’s an important difference in the SELECT clause, which determines what kind of results the query returns:

Select

The SELECT clause, used without the VALUE keyword, can return one or more values, each of which must be given an alias with the AS keyword. But rather than returning the objects directly, SELECT wraps them in a DbDataRecord that you access using classic ADO.NET techniques.

Image

Select value ...

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.