开发者

is there any reason to use entity SQL over Linq?

Entity framework provides at least two ways to query da开发者_如何学编程ta: Entity SQL and Linq?

Linq sounds like a better option.

Any reason one should care about Entity SQL?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜