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

Literal values in entity SQL

So far, the literals in our examples have been either String or Int32, both of which use the syntax you’d expect from programming. But Entity SQL isn’t very smart about interpreting literal values, and the syntax can be, well, a little verbose. You can find all the gory details on MSDN (search for “Literals (Entity SQL”), but here are the basics:

Image

Now the ugly bit: If you express a literal value using the wrong syntax, you won’t necessarily get an error. But you won’t necessarily get the correct results, either. (And yes, once again, the voice of experience. I want the three days I spent debugging that query back.) ...

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