title: How do you map subclass properties to columns in Table per Hierarchy?
body: <p><strong>Note:</strong> I think this is technically still code-first but I have an existing database as well so I'm not generating models or the database on the fly (no .edmx).</p>
  
  <p>I have a TPH situation where the subclasses have fields specific to them.  I have an <code>EntityTypeConfiguration</code> defined for the base class.  <strong>How do I map the subclass-specific fields to columns in my database table?</strong></p>
  
  <pre><code>public class Letter
  {
      public string Name { get; set; }
  }
  
  public class A : Letter
  {
      public int quantity { get; set; }
  }
  
  public class B : Letter
  {
      public ComplexType description { get; set; }
  }
  
  
  
  public class LetterMap : EntityTypeConfiguration&lt;Letter&gt;
  {
      HasKey...
  }
  </code></pre>
  
  <p>This is EF 4.1.</p>
  
  <p>Edit:</p>
  
  <p>I've implemented the solution Eranga suggested <a href="https://stackoverflow.com/questions/7231173/how-do-you-map-subclass-properties-to-columns-in-table-per-hierarchy/7231294#7231294">below</a>.  My problem now is that two subclasses map different values to the same column. (A third subclass doesn't populate the column at all which is why I can move the property up a level).</p>
  
  <blockquote>
    <p>(590,6) : error 0019: Each property name in a type must be unique.
    Property name 'Description_Title' was already defined.</p>
  </blockquote>
  
  <p>For example:</p>
  
  <p>B.description.title maps to the column "Description_Title"</p>
  
  <p>while</p>
  
  <p>C.description.shortTitle maps to the same column</p>