title: Entity Framework CTP5, code-first. Optional navigation property
body: <p>I'm using Entity Framework CTP5 (code-first) and I have two classes:</p>
  
  <pre><code>public class Order
  {
     public int Id {get;set;}
     public decimal SomeOtherProperty1 {get;set;}
  
     //navigation property
     public virtual ICollection&lt;OrderLine&gt; OrderLines { get; set; }  
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public class OrderLine
  {
     public int Id {get;set;}
     public int OrderId {get;set;}
     public decimal SomeOtherProperty2 {get;set;}
  
     //navigation property
     public virtual Order Order { get; set; }
  }
  </code></pre>
  
  <p>And I have the following configuration class for OrderLine class:</p>
  
  <pre><code>public partial class OrderLineMap : EntityTypeConfiguration&lt;OrderLine&gt;
      {
          public OrderLineMap()
          {
              this.HasKey(ol=&gt; ol.Id);
  
              this.HasRequired(ol=&gt; ol.Order)
                  .WithMany(o =&gt; o.OrderLines)
                  .HasForeignKey(ol=&gt; ol.OrderId);
  
          }
      }
  </code></pre>
  
  <p>Currently if you create an 'OrderLine' instance, you have to specify an 'Order' instance. </p>
  
  <p>The question: how can I make ol.Order property optional (null in some cases)? Is it possible? </p>