Monitor Your EF4 Queries with Entity Framework Profiler

Entity Framework is wonderful for non-SQL developers like me. I can implement data access code in VB-like object syntax or with drag’n’drop datasource controls and then let EF turn it into T-SQL.

For the most part, I’m happy to be insulated from the SQL queries that the ASP.NET EntityDataSource and EF statements generate.  However, sometimes a query doesn’t return the expected result and it helps to look behind the scenes to see what’s going  on.

Based on a recommendation by fellow MVP Julie Lerman (her latest book, Programming Entity Framework, Second Edition  is just off the presses) I tried out  out Entity Framework Profiler by Oren Eini, another Microsoft Most Valuable Professional. Wow! Nice tool!

Within a minute after setup, Entity Framework Profiler showed me the SQL statement that had been executed - and my error. (It was a stupid mistake where the Web control was returning an Int32 but I had thought I was dealing with a different property, a string.)

Entity Framework Profiler shows the duration of queries, the number of rows returned, and details about the transactions. With this information I’ll be able to tune and combine the EF statements for efficiency.

My only complaint about Entity Framework Profiler is most likely a problem with Microsoft’s WPF. Some screen re-writes leave strange artifacts on my triple monitor setup. It’s a cosmetic annoyance that doesn’t affect the use of the software.

Ken

1 Comment

  • It`s fantastic tool, Entity Framework profiler, help me to solve a stupid mistake where i had use another property. I prefer Framework 4.0 and VS2010. Its nice

Comments have been disabled for this content.