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
another option if you are using Entity Framework 6 is use the new feature to logging whats is happen, you can get the t-sql and the query time:
Logging and Intercepting Database Operations
using (var context = new BlogContext())
{
context.Database.Log = Console.Write; //here, you can write this info to a text file for example.
// Your code here...
}