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

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.