How to get the mapping table name for Entity in the Entity-framework in a program

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

+4
source share
3 answers

In EF v1.0, ToTraceString is the only way.

+1
source

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.

0
source

You can use the <dataContext> property. <EntityName> .CommandText to get the name Entity. Maybe this helps ...

-1
source

All Articles