title: Entity code first zero or one to zero or one relationship
body: <p>What is the solution to manage Entity code first zero or one to zero or one relationship ?</p>
  
  <p>I would like to have a nav property on the two entities.</p>
  
  <p>I already test with data annotation :</p>
  
  <pre><code>public class class1()
  {
      public int Id {get;set;}
      public virtual Class2 Class2 {get;set;}
  }
  
  public class class2()
  {
      public int Id {get;set;}
      public int? Class1Id {get;set;}
      [Required, ForeignKey("Class1Id")]
      public Class1 Class1 {get;set;}
  }
  </code></pre>
  
  <p>I always have an error message : "Class1_Class2_Target: : Multiplicity is not valid in Role 'Class2_Class1_Target' in relationship 'Class2_Class1'. Because the Dependent Role properties are not the key properties, the upper bound of the multiplicity of the Dependent Role must be '*'".</p>
  
  <p>I found samples with fluent API but if it's possible I would like to use data annotations. Indeed, for all examples using fluent api there is a navigation property but the int foreign key is deleted from the class :</p>
  
  <pre><code>class Class1Map : EntityTypeConfiguration&lt;Class1&gt;
  {
      public Class1Map()
      {
          this.HasKey(c =&gt; c.Id);
          this.Property(c =&gt; c.Id)
              .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
          this.HasRequired(c1 =&gt; c1.Class2).WithRequiredPrincipal(c2 =&gt; c2.Class1);
      }
  }
  
  public class Class1()
  {
      public int Id {get;set;}
      public virtual Class2 Class2 {get;set;}
  }
  
  public class Class2()
  {
      public int Id {get;set;}
  /* Missing Class2Id Property */
      public virtual Class1 Class1 {get;set;}
  }
  </code></pre>