Which technique should be used for building and executing dynamic queries?
-
Entity SQL
-
LINQ to Entities
-
LINQ to SQL
-
LINQ to Entity SQL
Entity SQL is specifically designed for building and executing dynamic queries at runtime, as it's a string-based query language similar to traditional SQL. LINQ to Entities is compile-time bound and not suitable for truly dynamic queries. LINQ to SQL is a different technology for SQL Server specifically, not Entity Framework.
Entity SQL is the technique designed for building and executing dynamic queries against the Entity Framework's conceptual model — it lets you construct query strings at runtime (e.g., varying WHERE clauses or projections based on user input) and execute them via ObjectQuery, similar to how dynamic SQL works for relational queries. LINQ to Entities and LINQ to SQL are compiled/expression-tree based and are strongly typed at compile time, making them poor fits for fully dynamic query construction. 'LINQ to Entity SQL' isn't a real, distinct technology name.