title: EF Code First foreign key without navigation property
body: <p>Let's say I have the following entities:</p>
  
  <pre><code>public class Parent
  {
      public int Id { get; set; }
  }
  public class Child
  {
      public int Id { get; set; }
      public int ParentId { get; set; }
  }
  </code></pre>
  
  <p>What is the code first fluent API syntax to enforce that ParentId is created in the database with a foreign key constraint to the Parents table, <strong>without the need to have a navigation property</strong>?</p>
  
  <p>I know that if I add a navigation property Parent to Child, then I can do this:</p>
  
  <pre><code>modelBuilder.Entity&lt;Child&gt;()
      .HasRequired&lt;Parent&gt;(c =&gt; c.Parent)
      .WithMany()
      .HasForeignKey(c =&gt; c.ParentId);
  </code></pre>
  
  <p>But I don't want the navigation property in this particular case.</p>