Entity Framework 4.0: How to see SQL statements for SaveChanges method

后端 未结 6 723
长发绾君心
长发绾君心 2020-12-09 02:26

I used to use the context.Log for tracing LINQ to SQL generated SQL Statements as shown in Sql Server Query Visualizer – Cannot see generated SQL Query

conte         


        
6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 02:46

    I believe you can use ToTraceString method of the ObjectQuery instance you have. Another approach would be to look at the IntelliTrace of Visual Studion as it logs SQL going out of your project.

提交回复
热议问题