views:

48

answers:

3

How do I output/log the sql being executed behind the scenes by the Entity Framework in an asp .net mvc application? In my case I'm using a Sql Server 2005 database.

I found this question Linq to Sql logging, but I'm trying to figure out how to do this with the entity framework v1 and asp .net mvc 1.0. Any one have any ideas on how?

A: 

http://efprof.com/

mcintyre321
+1  A: 

I answered this here: http://stackoverflow.com/questions/2218370/round-trip-logging-in-entity-framework/2218387#2218387

Or you can use Ayendes: http://efprof.com/

Luhmann
Thanks for the links. Don't think I can afford Ayendes profiler atm, but it's good to know such a tool exists. I'll probably play w/ the ObjectQuery.ToTraceString and dig through other objects in the framework to see if it can just be written out as that link says.
Jason
+2  A: 

You may take a look at this article and especially the EFTracingProvider.

Darin Dimitrov