2

Is there a way to get all the SQL change script of the object context?

Note: I am not talking about ObjectQuery.ToTraceString();

Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632

1 Answers1

6

No unfortunately there isn't anything 'in' the product and available directly off the ObjectContext.

However you should take a look at Jarek's TracingProvider, that injects a layer between the EF and SqlClient to do logging etc.

Read about it here.

Alex James
  • 20,874
  • 3
  • 50
  • 49
  • Thanks for the answer. The solution is really amazing, and helps us reduce statement length and amount of queried data. I described the integration of EFTracingProvider on my blog http://devio.wordpress.com/2010/01/28/tracing-sql-statements-generated-by-entity-framework/ – devio Jan 28 '10 at 18:21
  • If this is true, then how do you think LINQPad, for instance, show all the generated SQL when I run a C# program with an EF ObjectContext? Do you think it also just has some smart engineering similar to TracingProvider to get that to work? – JoeCool Aug 21 '13 at 15:46