title: Entity Framework - Get Table name from the Entity
body: <p>I'm using the Entity Framework 4.1 with Code First approach. I'm able to get the storage model types and column names of my entities:</p>
  
  <pre><code>var items = context.ObjectContext.MetadataWorkspace.GetItems&lt;EntityType&gt;(DataSpace.SSpace);
  
  foreach (var i in items)
  {
      Console.WriteLine("Table Name: {0}", i.Name);
  
      Console.WriteLine("Keys:");
      foreach (var key in i.KeyMembers)
          Console.WriteLine("\t{0} ({1})", key.Name, key.TypeUsage.EdmType.FullName);
  
      Console.WriteLine("Members:");
      foreach (var member in i.Members)
          Console.WriteLine("\t{0} ({1})", member.Name, member.TypeUsage.EdmType.FullName);
  }
  </code></pre>
  
  <p>What I need is to get the real table name the entity is mapped to. There are different ways to specify that (by using Fluent-API .ToTable(), DataAnnotation [TableAttribute]).</p>
  
  <p>Is there any common way to achieve this information?</p>