title: One to zero-or-one with HasForeignKey
body: <p>I have two models:</p>
  
  <pre><code>public class Person
  {
      public virtual int Id { get; set; }
      public virtual Employee Employee { get; set; } // optional
  }
  
  public class Employee
  {
      public virtual int Id { get; set; }
      public virtual int PersonId { get; set; }
  
      public virtual Person Person {get; set; } // required
  }
  
  public class EmployeeConfiguration : EntityTypeConfiguration&lt;Employee&gt;
  {
      public EmployeeConfiguration()
      {
          Property(e=&gt;e.PersonId) // I need this property mapped
              .HasColumnName("person_id")
              .HasColumnType("int");
      }
  }
  </code></pre>
  
  <p>I want to map them using fluent mapping. Employee table has column 'person_id' which is non-nullable. I tried following:</p>
  
  <pre><code>HasRequired(e =&gt; e.Person)
      .WithOptional(p =&gt; p.Employee)
      .Map(m =&gt; m.MapKey("person_id"));
  </code></pre>
  
  <p>But it fails with:</p>
  
  <blockquote>
    <p>System.Data.Entity.ModelConfiguration.ModelValidationException : One
    or more validation errors were detected during model generation:</p>
    
    <p>person_id: Name: Each property name in a type must be unique. Property
    name 'person_id' is already defined.</p>
  </blockquote>
  
  <p>I need PersonId property on its own, so what I basically want is:</p>
  
  <pre><code>HasRequired(e =&gt; e.Person)
      .WithOptional(p =&gt; p.Employee)
      .HasForeignKey(e =&gt; e.PersonId); // there is no such method
  </code></pre>
  
  <p>But <strong>there is no such method</strong> here as HasForeignKey</p>