title: EF: Foreign key in one-to-one relationship?
body: <p>Could you please explain this to me. Take this example:</p>
  
  <pre><code>public class Student
  {
      public Student() { }
  
      public int StudentId { get; set; }
      public string StudentName { get; set; }
  
      public virtual StudentAddress Address { get; set; }
  
  }
  
  public class StudentAddress 
  {
      [ForeignKey("Student")]
      public int StudentAddressId { get; set; }
  
      public string Address1 { get; set; }
      public string Address2 { get; set; }
      public string City { get; set; }
      public int Zipcode { get; set; }
      public string State { get; set; }
      public string Country { get; set; }
  
      public virtual Student Student { get; set; }
  }
  </code></pre>
  
  <p>I want to understand why we use the primary key in the dependent table as the foreign key, why don't we just follow the usual way: adding foreign column in the dependent table referring to the primary key from the principal table?
  And, can we reverse roles here, i.e. to use the primary key in Student entity as the foreign key?</p>