views:

310

answers:

4

Linq to entities seems much easier and safer than entity SQL. Can you give an example where using entity SQL makes more sense than Linq to entities?

+1  A: 

Entity SQL was the original language design for use with EF and bears many similarities with T-SQL. It can be a very useful stepping stone for migrating your DBAs to a domain-modelling framework. They can then move on to 'proper' LINQ to SQL.

Chris Arnold
Thank you for your answer. Do you have a specific example in mind where esql is better? Or is eSQL only for "sql oriented" people?
tom greene
Linq to SQL is not Entity Framework and doesn't use ESQL...
Thomas Levesque
+2  A: 

Personally I think the best use for EntitySQL is when you don't have any CLR classes for your entities:

I.e. using eSQL you can query against the conceptual model (with all the mapping flexibility the Entity Framework offers) without actually needing classes for each of your entities.

Alex

Alex James
+1  A: 

The main difference is that the first call of Entity SQL query is much faster than the call of the LINQ to Entities query (if itis not using CompiledQuery).
One more EFv1-specific feature is that internal database functions (defined in the provider manifest) could have been called only in Entity SQL queries.
Devart Team
http://www.devart.com/dotconnect
ADO.NET data providers for Oracle, MySQL, PostgreSQL, SQLite with Entity Framework and LINQ to SQL support

Devart
A: 

You can specify a (database) collation in ESQL, which you can't do in L2E (or LINQ-to-anything, actually). You can also specify the exact type with ISTYPE(ONLY ...), which you can't do in L2E.

Craig Stuntz