title: Can I mix Table per Hierarchy and Table per Type in Entity Framework?
body: <p>Say I have 2 tables: Message and SuperMessage</p>
  
  <p>and 3 entities: Message (base (not abstract)), Comment (inherits from Message) and SuperMessage (inherits from Message)</p>
  
  <p>Message has a non-nullable MessageType field which is used as a discriminator.</p>
  
  <ul>
  <li>MessageType = 1 means it is a Message</li>
  <li>MessageType = 2 means it is a Comment</li>
  <li>MessageType = 3 AND and join to the SuperMessage means it is a SuperMessage</li>
  </ul>
  
  <p>The problem is that I cannot specify a condition on MessageType of the SuperMessage's Mapping details section because it cannot see the MessageType field and I cannot ignore it.</p>
  
  <p>How can I make these work alongside eachother?</p>
  
  <p><strong>UPDATE</strong> Build Error:</p>
  
  <p>Error 3014: Problem in mapping fragments:The foreign key 'Foreign key constraint 'FK_SuperMessage_inherits_Message' from table SuperMessage (ID) to table Message (MessageId):' is not being enforced in the model. An Association or inheritance relationship needs to be created to enforce this constraint.</p>