title: ASP.NET MVC 3.0 2 Foreign Keys from the same table exception
body: <p>I have two tables and models corresponding to each table: Employee and EmployeeEducation 
  In EmployeeEducation I have 2 foreign keys from the table Employee: Id for consultant and id for actual employee who owns the educations. Each education can have different consultant.</p>
  
  <pre><code>[Required(ErrorMessage = "Contact Admin")]
  [Display(Name = "Consultant")]
  public int? ConsultantId { get; set; }
  *emphasized text*
  [Required(ErrorMessage = "Contact Admin")]
  public int? EmployeeId { get; set; }
  </code></pre>
  
  <p>For each id ı have these objects to reach the objects </p>
  
  <pre><code>[ForeignKey("EmployeeId")]
  public virtual Employee Employee { get; set; }
  
  [ForeignKey("ConsultantId")]
  public virtual Employee Consultant { get; set; }
  </code></pre>
  
  <p>When I run the code and try to enter an education to the employee with the consultant it gives me following exception with an inner exception.</p>
  
  <pre><code>EntityCommandExecutionException 
  {"An error occurred while executing the command definition. See the inner exception for details."}
  
  Inner exception: SqlCeException
  {"The column name is not valid. [ Node name (if any) = Extent1,Column name = Employee_Id ]"}
  </code></pre>
  
  <p>But when I remove Consultant object it does not give an exception.
  How can I solve this problem so that i have access to both Consultant and Employee itself?</p>
  
  <p>The exception happens in DetailsEducation.cshtml:</p>
  
  <pre><code>@{ if (Model.EducationList == null || !Model.EducationList.Any())
      { 
  </code></pre>
  
  <p>Here is how EducationList is populated:</p>
  
  <pre><code>public ActionResult DetailsEducation(int id) 
  { 
    Employee employee = _work.EmployeeRepository.GetSet()
      .Include(a =&gt; a.EducationList)
      .Include(a =&gt; a.EducationList.Select(c =&gt; c.University))
      .Include(a =&gt; a.EducationList.Select(c =&gt; c.Department))
      .FirstOrDefault(a =&gt; a.Id == id); 
    return PartialView("_DetailsEducation", employee);
  }
  </code></pre>