title: How can I specify the type of a property in an inherited entity?
body: <p>I have recently started to use entity framework on projects, and I was wondering on how to model a specific case.</p>
  
  <p>Consider this scenario :</p>
  
  <ul>
  <li>My application needs to model several types of contracts</li>
  <li>Every type of contract contains one or more instances of subcontracts</li>
  <li>Every type of contract exposes its subcontracts in a collection</li>
  <li>Every type of contract can only contain subcontracts of a specific type corresponding to the one of the contract (A contract of type <code>ContractA</code> will only contain subcontracts of type <code>SubcontractA</code>, a contract of type <code>ContractB</code> will only contain subcontracts of type <code>SubcontractB</code>)</li>
  </ul>
  
  <p>What would be the best way to model this in an entity framework model ?</p>
  
  <p>My first try used an association between the base types, but I wanted to be able to specify the type of Subcontracts on each derived type of Contract, without having two different properties on the specific type of Contract.</p>