0

I am reading entity name from ChangeTracker.Entries().GetType().Name but it has string of random numbers attached to entity name. Is there a way to get correct entity/table name.

Thanks

Bhavesh
  • 819
  • 1
  • 17
  • 31
  • Possible duplicate of [Get Database Table Name from Entity Framework MetaData](https://stackoverflow.com/questions/1895455/get-database-table-name-from-entity-framework-metadata) – CodeNotFound Nov 20 '17 at 07:07
  • did quick look at that but didn't see easy way to do it (& didn't bother reading long code). have found simple way to get it and have added it here just in case if somebody needs it – Bhavesh Nov 20 '17 at 07:12

1 Answers1

2

found solution

ObjectContext.GetObjectType(change.Entity.GetType()).Name

Bhavesh
  • 819
  • 1
  • 17
  • 31