Is there a way to get the mapping table name for Entity in the Entity-framework in a program? I know that you can use .ToTraceString () to get the command text and then extract the table name, but the ToTraceString () method is very slow. is there any other way to use ObjectContext.MetadataWorkspace? Thanks
In EF v1.0, ToTraceString is the only way.
Thank you for your answer, but the code above works for LINQ to SQL, it does not work for the Entity framework, because entity classes in EF do not have a table name attribute. The mapping information is in the edmx file in XML.
You can use the <dataContext> property. <EntityName> .CommandText to get the name Entity. Maybe this helps ...