Where to find translated Linq to Entity query to Sql

后端 未结 3 846
臣服心动
臣服心动 2021-01-18 01:30

I want to get the translated Linq query programmatically and do some stuff with that Sql syntax.

Suppose this is my code:

public class MyApiControlle         


        
3条回答
  •  野的像风
    2021-01-18 02:17

    You can call the ToString() method on objs. This will result in a call to the ToTraceString method that returns the executed SQL:

    string sql = objs.ToString();
    

提交回复
热议问题