4

Entity framework provides at least two ways to query data: Entity SQL and Linq?

Linq sounds like a better option.

Any reason one should care about Entity SQL?

moi_meme
  • 9,180
  • 4
  • 44
  • 63
user380719
  • 9,663
  • 15
  • 54
  • 89

1 Answers1

4

I used EntitySQL in order to generate complex condition on the fly without using something like Predicate Builder. But i agree that Linq3Entities is better since you get compile time check on your query.

EDIT
In Entity SQL i can do this:

context.Entities.Where("it.Id IN { 1, 2, 3 }");

with it i build a string to add multiple condition with 'And' and 'Or'

You can also see the multiple post on StackOverflow about this: here and here
or other link Linq-to-SQL vs Linq-to-Entities : Revisited or Choosing LINQ to Entities vs Entity SQL vs. EntityClient

Community
  • 1
  • 1
moi_meme
  • 9,180
  • 4
  • 44
  • 63