title: Multiplicity constraint violated. The role Child_Parent_Target of the relationship Child_Parent has multiplicity 1 or 0..1
body: <p>I did a lot of research but haven't found any answer that matches my problem. I even tried to use the <em><a href="https://stackoverflow.com/questions/5538974/the-relationship-could-not-be-changed-because-one-or-more-of-the-foreign-key-pro">The relationship could not be changed because one or more of the foreign-key properties is non-nullable</a></em> example. No success.</p>
  
  <p>I'm working with Entity Framework 6 Code First (Fluent API), POCO Classes.</p>
  
  <p>I have a class called Parent and a class called Child</p>
  
  <p>One Parent can have one or more Childs (one to many relationship)</p>
  
  <p>So, in my ParentMapping class I did:</p>
  
  <pre><code>HasMany(p =&gt; p.Childs).WithRequired(p =&gt; p.Parent).Map(m =&gt; m.MapKey("ParentId"));
  </code></pre>
  
  <p>and in my ChildMapping class I did:</p>
  
  <pre><code>HasRequired(p =&gt; p.Parent).WithMany(p =&gt; p.Childs).Map(m =&gt; m.MapKey("ParentId"));
  </code></pre>
  
  <p>I persist (Insert, Update and Delete) my child poco class at the same time I persist the parent class. So every time I save my parent class, it has one or more child objects in its <em>Childs</em> property. Thus the parent object is responsible for persist its child objects.</p>
  
  <p>I followed the example above (see the link) to save data into the database.</p>
  
  <p>I get below message when I try to add a new child to the db existent Parent, which already has one child in the database, and call the <em>db.SaveChanges</em>:</p>
  
  <p><strong>Multiplicity constraint violated. The role Child_Parent_Target of the relationship Child_Parent has multiplicity 1 or 0..1.</strong></p>
  
  <p>Can anyone help me? I'm struggling with this and see no light in the end of the tunnel.</p>