title: Entity Framework 6 code first handing shadow properties
body: <p>I know how to do handing shadow properties in entity framework core</p>
  
  <p>I thought that will be same in entity framework 6.</p>
  
  <p>It turns out not same as I thought.</p>
  
  <p>Basically I have a interface named:</p>
  
  <pre><code>public interface IAuditable { }
  </code></pre>
  
  <p>It is pretty sample do it on OnModelCreating function in EF core:</p>
  
  <pre><code>foreach (var entityType in modelBuilder.Model.GetEntityTypes())
          {
              if (typeof(IAuditable).IsAssignableFrom(entityType.ClrType))
              {
                  modelBuilder.Entity(entityType.ClrType).Property(typeof(string), Auditable.CreatedBy).HasMaxLength(50).IsRequired();
                  modelBuilder.Entity(entityType.ClrType).Property(typeof(string), Auditable.UpdatedBy).HasMaxLength(50).IsRequired();
                  modelBuilder.Entity(entityType.ClrType).Property(typeof(DateTime), Auditable.CreatedOn).IsRequired();
                  modelBuilder.Entity(entityType.ClrType).Property(typeof(DateTime), Auditable.UpdatedOn).IsRequired();
              }
          }
  </code></pre>
  
  <p>But EF 6 don't have modelBuilder.Model property, </p>
  
  <p>So I have convert [ef core code] to [ef 6] ?</p>