Best way to show the SQL trace of a LINQ query to Entity Framework 3.5

后端 未结 3 739
无人共我
无人共我 2021-01-25 05:37

Best way to show the SQL trace of a LINQ query to Entity Framework 3.5?

I am using ASP.net and EF 3.5.

Dim dbo As Web.Portal.RBMEntities = New Web.Portal         


        
3条回答
  •  野性不改
    2021-01-25 05:58

    I just attempted to do this:

            Dim TraceString As String = TryCast(Query, ObjectQuery).ToTraceString
    

    Which works great and returns the SQL trace of the LINQ statement.

提交回复
热议问题