title: Entity Framework 1 to 1 relationship using code first. how?
body: <p>I have two classes.  How can I turn these two classes into a one to one relationship using the entity framework code first method?</p>
  
  <pre><code>public class Region
  {
    public int RegionId { get; set; }
    public string Name { get; set; }
  
    public virtual Factory _factory { get; set; }
  }
  
  public class Factory
  {
    public int FactoryId { get; set; }
    public string Name { get; set; }
  
    public virtual Region _region { get; set; }
  }
  </code></pre>
  
  <p>When I try this, I get this error:
  Multiplicity is not valid in Role 'Region_Factory_Source' in relationship 'Region_Factory'. Because the Dependent Role properties are not the key properties, the upper bound of the multiplicity of the Dependent Role must be '*'.</p>