I'm trying to figure out a way to get the underlying SQL table name for a given entity type. I've experimented around with the MetadataWorkspace queries and while I can get lots of information from the object or the storage space, I can't seem to figure out how to map between the two.
So say I have a type in the object model called Lookup - how do I find the tablename (wws_lookups) in the database?
I can query all the EntityType objects for CSpace and SSpace and I can see both listed correctly but I can't figure out how to get SSpace from CSpace.
Is there any way to do this?
You can try MappingAPI extension: https://efmappingapi.codeplex.com/
It is really easy to use
EF 6.1, code-first:
If you are using the T4 template for POCO classes you can get it by altering the T4 Template. See snippet:
Alex is right - this is a sad limitation in the Metadata API. I have to just load the MSL as an XML document and do lookups of S-space entities as I process my C-space model.