Search code examples
c#linq-to-sqlcompiled-query

get generated sql from a compiled linq query


Is it possible to get the generated SQL from a compiled linq query?


Solution

  • You can:

    1. Use the log property of the context to redirect the generated query to the output window of Visual Studio. link
    2. Or use the LINQ to SQL Debug Visualizer. link