Entity Framework 6: Clone object and relations except ID
<p>would you please tell me if I have some code like this : </p>

<pre><code>using(var database = new MyDbContext()) {
MyModel myModel = database.Where(m =&gt; m.SomeProperty == someValue);
myModel.SomeOtherProperty = someOtherValue; //user changed a value
database.MyModels.Add(myModel); //even though the ID of myModel exists in the database, it gets added as a new row and the ID gets auto-incremented 
database.SaveChanges()
}
</code></pre>

<p>does it add the relationship Rows with new IDs ? </p>

<p>for Example if I have <strong>tbl_order</strong> and it has some childs in <strong>tbl_order_details</strong> , if I clone that by the code above , does it add tbl_order_details rows with new IDs ? </p>

<p><em>I found this solution here : <a href="https://stackoverflow.com/questions/25720803/entity-framework-6-clone-object-except-id">Entity Framework 6: Clone object except ID</a> <strong>but here don't explain about the relations</em></strong></p>