Convert EF Entity Framework or Linq to SQL

Tags: Convert, EF, Entity, Framework, Linq, SQL

-------------------------------------------

Using code in Visual Studio

-------------------------------------------

.ToString();

.ToTraceString();

dc.GetCommand(query).CommandText

p.InternalQuery

Logging and Interception

From the database context

-------------------------------------------

Using Tools

-------------------------------------------

LINQPad

SQL Profiler

Further info:

https://stackoverflow.com/questions/22559346/how-to-convert-this-simple-entity-framework-query-into-a-standard-sql-query

https://stackoverflow.com/questions/6190620/how-to-see-generated-sql-from-a-linq-query

https://stackoverflow.com/questions/1412863/how-do-i-view-the-sql-generated-by-the-entity-framework

http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.getcommand.aspx

http://sampathloku.blogspot.com/2012/08/how-to-convert-linq-entity-query-into-t.html

https://stackoverflow.com/questions/23176321/convert-entity-framework-program-to-raw-sql

https://stackoverflow.com/questions/48732605/convert-sql-server-query-to-entity-framework-query

No Comments

You must log on to comment.