title: Entity Framework : map multiple classes to one table
body: <p>I think this is possible in nhiberate, but my question is about Entity Framework.</p>
  
  <p>In my database model - which I cannot modify - I have redundant columns that I would like to store in different classes.</p>
  
  <p>Example :</p>
  
  <pre><code>public class DateParams
  {
      public DateTime CreationDate { get; set; }
      public DateTime ModificationDate { get; set; }
  
      // some methods
  }
  
  public class Localization
  {
      public String EnglishLabel { get; set; }
      public String FrenchLabel { get; set; }
  
      // some methods
  }
  </code></pre>
  
  <p>And then I would use them in some of my models :</p>
  
  <pre><code>public class Account // Localization &amp;&amp; DateParams 
  {
      public int ID { get; set;  }
      public String Name { get; set; }
  
      public Localization Localization { get; set; }
      public DateParams DateParams { get; set; }
  }
  
  public class Lead // DateParams only
  {
      public int ID { get; set; }
      public String Name { get; set; }
  
      public DateParams DateParams { get; set; }
  }
  </code></pre>
  
  <p>What I would like to achieve is having something like this </p>
  
  <pre><code>public class LocalizationMap : EntityTypeConfiguration&lt;Localization&gt;
  {
     public LocalizationMap()
     { 
          Property(e =&gt; e.EnglishLabel).HasColumnName("en");
          Property(e =&gt; e.FrenchLabel).HasColumnName("fr");
     }
  }
  
  public class AccountMap : EntityTypeConfiguration&lt;Account&gt;
  {
      public AccountMap()
      {            
          HasKey(x =&gt; x.ID);
          Property(e =&gt; e.Name).HasColumnName("Name");
  
          HasSubMapping(new LocalizationMap());
          HasSubMapping(new DateParamsMap());
  
          ToTable("Account");
      }
  }
  </code></pre>
  
  <p>I could use inheritance to solve this, but C# does not allow multiple inheritance.</p>