O'Reilly logo

Fluent Entity Framework by Rebecca M. Riordan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required