← Tutti gli articoli

How to see the SQL statements that your Entity Framework application executes.

27 agosto 2012  · EDF · Article  ·  394 visite

How to see the SQL statements that your Entity Framework application executes.

  1. var contents = from c  in  context.Contents  
  2.             where c.Title == "Asp.net"  
  3.             select c;  
  4. ObjectQuery objectQuery = (ObjectQuery)contents;  
  5. Console.WriteLine(objectQuery.ToTraceString());