One way to do this:
((EdmItemCollection)ctx .MetadataWorkspace .GetItemCollection(DataSpace.CSpace)) .GetItems<EntityType>()
I have not tried it before, but you can even get items directly from the workspace:
ctx.MetadataWorkspace.GetItems<EntityType>(DataSpace.CSpace)
If you are using a DbContext, you can get an ObjectContext as follows:
((IObjectContextAdapter)ctx).ObjectContext
Pawel source share