One of the patterns in EF 6.x for attaching new entities to a context is to simply change it’s state to Added:
ctx.Entry(myEntity).State = EntityState.Added;
Entity Framework 6.x will traverse the entity graph of all the related entities and set all their states to Added too. This might be a problem.
Imagine we want to attach a disconnected (new) entity that is linked to an existing one, for which we already have a reference. In this case, we don’t want this reference to be added, because doing so will raise a violation on the database and it will come out as an exception.