Retrieve LINQ to sql statement (IQueryable) WITH parameters

前端 未结 4 2052
广开言路
广开言路 2021-02-01 14:16

I\'m trying to figure out if there\'s a way to retrieve the (full) sql statement that gets executed on the database server.
I found something already, but it does not exactl

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-01 14:47

    (SqlCommand)dataContext.GetCommand(query)
    

    will give you access to Parameters collection.

提交回复
热议问题