在Visual Studio中查看为实体Framewok SaveChanges命令生成的SQL? [英] view generated SQL for Entity Framewok SaveChanges command in Visual studio?

查看:68
本文介绍了在Visual Studio中查看为实体Framewok SaveChanges命令生成的SQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以看到由Entity Framework生成的SQL,用于Visual Studio中的选择操作,但不能用于插入,更新和删除.调试时如何查看在Visual Studio中为"DataContext.SaveChanges"命令生成的SQL?

I can see the SQL generated by Entity Framework for select operations in Visual studio, but not for insert, update and delete. how can I see the SQL generated for "DataContext.SaveChanges" command in Visual studio while debugging?

推荐答案

如果您拥有Visual Studio Ultimate,则可以在intellitrace中看到更新和插入内容.只需在调用SaveChanges之后放置一个断点即可.

If you have visual studio ultimate you can see the updates and inserts in intellitrace. Just put a breakpoint right after SaveChanges is called.

http://www.youtube.com/watch?v=fLBpZNXs-Lw

如果在Web项目上使用它,则也可以使用mini-profiler.

If you are using it on a web project you could also use mini-profiler.

http://miniprofiler.com/

这篇关于在Visual Studio中查看为实体Framewok SaveChanges命令生成的SQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆