title: Entity Framework Code First - map same entity twice for different purpose
body: <p>I have two models, One <code>ApplicationUser</code> which holds all users in the system and I have a Quotation model which will hold all <code>Quotations</code> made. now I want to store two mappings to <code>ApplicationUser</code> inside <code>Quotations</code>. So that I can map to created User as well as cancelled User. My model looks like this</p>
  
  <pre><code>    public class Quotation
  {
      public int QuotationID { get; set; }
      public DateTime QuotationDate { get; set; }
      public DateTime QuotationCancelDate { get; set; }
      public int ApplicationUserID { get; set; }
      public virtual ApplicationUser CreatedUser { get; set; }
      [ForeignKey("ApplicationUserID")]
      public ApplicationUser CancelledUser { get; set; }
  
  }
  </code></pre>
  
  <p>But this throws an error</p>
  
  <pre><code>Quotation_CancelledUser_Target_Quotation_CancelledUser_Source: : The types of all properties in the Dependent Role of a referential constraint must be the same as the corresponding property types in the Principal Role. The type of property 'ApplicationUserID' on entity 'Quotation' does not match the type of property 'Id' on entity 'ApplicationUser' in the referential constraint 'Quotation_CancelledUser'.
  </code></pre>
  
  <p>So I guess , The approach I am taking is wrong. Can anyone point out the correct way to achieve this?</p>