title: ASP.NET MVC: How to properly reference custom object to ApplicationUser?
body: <p>currently I am trying to connect my custom object to Application User, which is auto-generated by Visual Studio.</p>
  
  <p><code>Employee.cs</code></p>
  
  <pre><code>public class Employee
  {
      [Display(Name = "ID")]
      [Key]
      public int EmployeeID { get; set; }
  
      [ForeignKey("ApplicationUser")]
      public int ApplicationUserID { get; set; }
  
      [Required]
      [DataType(DataType.Currency)]
      public decimal MonthlySalary { get; set; }
  
      [Required]
      public string Experience { get; set; }
  
      [Required]
      public string Description { get; set; }
  
      public string PhotoURL { get; set; }
  
      public virtual ApplicationUser ApplicationUser { get; set; }
  }
  </code></pre>
  
  <p>Error is:</p>
  
  <blockquote>
    <p>There was an error running the selected code generator: 'Unable to
    retrieve metadata for Models.Tables.Employee. One or more validation
    errors were detected during model generation: 
    Parent_ApplicationUser_Target_Parent_ApplicationUser_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 'ApplicationUserlD' on entity
    'Parent' does not match the type of property 'Id' on entity
    'ApplicationUser' in the referential constraint
    'Parent_ApplicationUser. Employee ApplicationUser Target Employee
    ApplicationUser 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
    'ApplicationUserlD' on entity 'Employee does not match the type of
    property 'Id' on entity 'ApplicationUser' in the referential
    constraint 'Employee_ApplicationUser.</p>
  </blockquote>
  
  <p><code>Parent</code> table contains same <code>ApplicationUser</code> reference as <code>Employee</code>.
  What am I doing wrong? Thanks for help</p>