title: Is many to optional one relation possible?
body: <p>I have the following situation: a <code>Device</code> can have multiple <code>Subscriptions</code>, but a <code>Subscription</code> has maximum one <code>Device</code> or none at all. In my database <code>Subscriptions</code> has a foreign key <code>DeviceID</code> which is <code>Nullable</code> (not the <code>ID</code> property in <code>Device</code> class). At the moment for some reason the following fluent code works:</p>
  
  <pre><code>            modelBuilder.Entity&lt;Device&gt;()
              .HasMany(e =&gt; e.Subscriptions)
              .WithRequired(e =&gt; e.Device)
              .WillCascadeOnDelete(false);
  </code></pre>
  
  <p>If I choose WithOptional(), which should be logical, I get errors. The error is this ModelvalidationError:</p>
  
  <blockquote>
    <p>Additional information: One or more validation errors were detected during model generation:</p>
    
    <p>Entities.Device_Subscriptions: : Multiplicity conflicts with
    the referential constraint in Role 'Device_Subscriptions_Source' in
    relationship 'Device_Subscriptions'. Because all of the properties in
    the Dependent Role are non-nullable, multiplicity of the Principal
    Role must be '1'.</p>
  </blockquote>
  
  <p>However If I now query for example (with the <code>.WithRequired(...)</code> code)</p>
  
  <pre><code>db.Subscriptions.Where(s =&gt; s.DeviceID == null).Count();
  </code></pre>
  
  <p>I get zero, although there is one <code>Subscription</code> in my database with <code>DeviceID</code> null. </p>
  
  <p>(partial)Model for <code>Device</code>:</p>
  
  <pre><code>public class Device
  {
      public Device() : base()
      {
          Subscriptions = new HashSet&lt;Subscription&gt;();
      }
      [Key]
      public decimal DeviceID { get; set; }
  
      public virtual ICollection&lt;Subscription&gt; Subscriptions {get; set;}
  }
  </code></pre>
  
  <p>(partial)Model for <code>Subscription</code>:</p>
  
  <pre><code>public partial class Subscription
  {
      [Key]
      [Column(Order = 0)]
      public decimal? DeviceID { get; set; }
  
      [Key]
      [Column(Order = 1)]
      [StringLength(50)]
      public string Type { get; set; }
  
      public virtual Device {get; set;}
  }
  </code></pre>