title: How to stop Entity framework from inserting associated entities?
body: <p>I am having problems when trying to insert an entity with null associated entities..</p>
  
  <p>I am just doing :</p>
  
  <pre><code>pUser.DogAndUser = null //dogAndUser is the relationship between dog and user 
  context.User.Add(pUser)
  </code></pre>
  
  <p>But here I am getting an error saying that the foreign key idDog does not exist in the table Dog. 
  And well..of course not..I am giving it a null association..Then I confirmed it was trying to insert the associated entities inserting a row in Dog and then passing the value in the DogAndUser relationship..which did not throw an error and did insert a row in the relationship..but why? I did not explicitly told it to do so..how can I stop this from happening? Thanks!</p>