title: Change name of Identity Column for all Entities
body: <p>I am in the process of creating a domain model and would like to have a "BaseEntity" class with an "Id" property (and some other audit tracking stuff).  The Id property is the primary key and each Entity in my Domain Model will inherit from the BaseEntity class.  Pretty straightforward stuff.....</p>
  
  <pre><code>public class BaseEntity
  {
      [Key]
      public int Id { get; set; }
  
      public DateTime LastUpdate { get; set; }
      public string LastUpdateBy { get; set; }
  }
  public class Location : BaseEntity
  {
      [Required]
      public string Name { get; set; }
  
      public string Description { get; set; }
  }
  </code></pre>
  
  <p>Using the example above, I would like to map the "Id" field to a "LocationId" column.  I understand that I can use the modelBuilder to do this for each entity explicitly by doing something like this:</p>
  
  <pre><code>modelBuilder.Entity&lt;Location&gt;().Property(s =&gt; s.Id).HasColumnName("LocationId");
  </code></pre>
  
  <p>But I would like to do this for every Entity in my domain model and it would be ugly.</p>
  
  <p>I tried the following bit of reflection but did not have any luck.  For whatever reason, the compiler "cannot resolve symbol type":</p>
  
  <pre><code>foreach (var type in GetTypesInNamespace(Assembly.Load("Domain.Model"),"Domain.Model"))
  {
      modelBuilder.Entity&lt;type&gt;().Property(x=&gt;x.Id).....
  }
  </code></pre>
  
  <p>Is there a way to define a convention to override the default PrimaryKey convention to map my "Id" property to a "ClassNameId" property in the database?  I am using Entity Framework 6.</p>