is there any way to retrieve mapping table name for an Entity in Entity-framework in program? I know you can use .ToTraceString() to get the command text and then extract the table name, but ToTraceString() method is very slow. is there any other way like using ObjectContext.MetadataWorkspace? Thanks
From stackoverflow
-
Thanks for your answer, but the code above works for LINQ to SQL, it does not work for Entity framework, because the entity classes in EF dont have table name attribute.the mapping information is in edmx file in XML.
-
You can use <dataContext>.<EntityName>.CommandText property to get the name of the Entity. Maybe that helps...
Jader Dias : Nope, you will only get the ObjectQuery object name this way. -
In the EF v1.0 ToTraceString is the only way.
Jader Dias : As far as I could find on the internet
0 comments:
Post a Comment