I have the following sample code:
Context context = new Context();
Repository repository = new Repository(context);
Post post = repository.First
You have a few options here.
((ObjectQuery)query).ToTraceString()
see https://stackoverflow.com/a/7901917/1070291 (I think this only works for queries so may not be the best in the above scenario)