More Beta 3 clues for Entity Framework: Compiled queries and TSQL in debugging

I sometimes feel like Gretel picking up tidbits on my way to the Gingerbread house when it comes to getting clues about what’s coming in Beta3 of Entity Framework.

The next two I have found are:

From Alex James blog, Entity Framework is getting compiled queries similar to what’s in LINQ to SQL. You can pre-compile query expressions, save them and even pass them around.

One thing that Alex mentions is that they are not tied to the ObjectContext (which is how you can pass them around) and therefore it must be the magic behind the next tidbit – which is that we’ll be able to get at the TSQL generated from the query expressions more easily.as per Danny Simmons in this forum thread.

It is currently possible to see the TSQL in a convoluded way of digging into the EntityCommand that is explained in the answer to this forum post. WHen I saw that, I tried to write a debugger visualizer but discovered that because the EntityCommand is not serializable (nor the objectQuery, from which you can grab the EntityCOmmand) there was no way to get the commandtree over to a separate process where the debugger is hosted. Someone actually got around it with an enormous number of lines of code (see this forum thread) but I decided that I would just bide my time for a simpler way to appear in the bits.

We’ll see in a few weeks what it looks like. 

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.