var query = (from x in context.MyEntity where x... select x); (query as ObjectQuery<MyEntity>).ToTraceString();
This will be printed in the trace log ... if you want a simple trace viewer (outside of Visual Studio) to exit DebugView
And as an additional note, the best โreal-timeโ profiler I used / saw there, the Entity Framework Profiler , you have to pay for it, but there is a trial version and it will give you SQL corresponding to the line of code. He also acknowledges common "problems." Installation is silly simple ... all you have to add is one statement in the initializer of your application.
** Edit to show how to do this with user code **
I think I can do all the hard work for you ...;). Since you are using an unworthy type, just leave the <T> .
var cklContactItems = from a in dbTestCenterViews.appvuChecklistExports where a.MarketChecklistID == MCLID && a.checklistSectionID == SID && a.fieldGroupOrder != null orderby a.fieldGroupOrder ascending select new { a.Column1, a.Column2, a.Column3, a.Column4, a.Column5, a.Column1FieldID, a.Column2FieldID, a.Column3FieldID, a.Column4FieldID, a.Column5FieldID, a.fieldGroupOrderLabel }; System.Diagnostics.Trace.WriteLine((query as ObjectQuery).ToTraceString());
source share