Parameterized queries

Since you build Entity SQL expressions as strings (and so Intellisense isn’t available) and because errors aren’t reported at compile time (and not necessarily at runtime), using literal values can be a little tedious. But in reality, you’ll hardly ever create query expressions with literals. In real applications, you’ll want to provide those values at runtime, and the Entity SQL ObjectQuery<T>.Parameters collection makes that easy, using the classic SQL @param syntax:

Image

Image Put On Your Thinking Hat

How’d you do?

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.