Where I can find SQL Generated by Entity framework?

added by jalpesh
12/19/2012 1:21:39 PM

0 Kicks, 112 Views

Few days back I was optimizing the performance with Entity framework and Linq queries and I was using LinqPad and looking SQL generated by the Linq or entity framework queries. After some point of time I got the same question in mind that how I can find the SQL Statement generated by Entity framework? After some struggling I have managed to found the way of finding SQL Statement so I thought it would be a great idea to write a post about same and share my knowledge about that. So in this post I will explain how to find SQL statements generated Entity framework queries. To demonstrate the idea Let’s a very simple console application with C# and then create a table called ‘Customer’ with CustomerId and CustomerName field in sql server.