Friday, July 25, 2008

I learned a neat ESQL trick from Danny Simmons today.

The most basic Entity SQL expression is one that would simply query for a single entity with no filters, no projection etc.

context.CreateQuery<Customer>("SELECT VALUE con FROM MYEntityContainer.Contacts AS con")

You can actually express the string using only the target collection:

context.CreateQuery<Customer>("MyEntityContainer.Contacts")

and EF will build the same command tree as it does for the first expression.

Friday, July 25, 2008 8:45:30 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  |