开发者

How can I see what TSQL Entity Framework is generating for a query?

Imagine this linq query:

return db.Projects.Where(p =&g开发者_C百科t; p.ProjectID == id);

How can I see what TSQL it's generating?


I use LINQPad

You can see your queries as lambda expressions or SQL


SQL Server profiler does exactly this. If you are on SQL Server Express, there is an open source alternative called AnjLab Sql Profiler since SQL server profiler isn't included with express.


You can attach the Sql Server Profiler to your database while running the query. Furthermore, have a look at the tracing and caching utility for EF.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜