Performance of Linq to Entities vs ESQL

前端 未结 6 851
情歌与酒
情歌与酒 2020-12-04 20:08

When using the Entity Framework, does ESQL perform better than Linq to Entities?

I\'d prefer to use Linq to Entities (mainly because of the strong-

6条回答
  •  被撕碎了的回忆
    2020-12-04 20:47

    Entity-SQL (eSQL) allows you to do things such as dynamic queries more easily than LINQ to Entities. However, if you don't have a scenario that requires eSQL, I would be hesitant to rely on it over LINQ because it will be much harder to maintain (e.g. no more compile-time checking, etc).

    I believe LINQ allows you to precompile your queries as well, which might give you better performance. Rico Mariani blogged about LINQ performance a while back and discusses compiled queries.

提交回复
热议问题