title: Weird Constraint Exception with entity framework
body: <p>I'm new to the Entities framework.
  One week earlier I've hit the common problem of the currentcontext that throws exception if used in a non-unique manner, but that was fixed.</p>
  
  <p>Today I have a new problem, a really new one because I do not even know why this is happening since I do think that I have the same code.</p>
  
  <p>Here is the error that I am getting :</p>
  
  <pre><code>Entities in 'Entities.WSUser_Detail' participate in 
  the 'FK_WSUser_Detail_WSCountry' relationship. 
  0 related 'WSCountry' were found. 1 'WSCountry' is expected.
  </code></pre>
  
  <p>What's so strange about this error is that in my code I never reference any WSUser_Detail object.
  Does anyone has come up with that kind of error?
  My code is really simple :</p>
  
  <pre><code>newUser = (from user in GB.Context.WSUsers
                  where user.IDUser == nFound
                  select user).FirstOrDefault();
  
  newUser.DoNotSend = false;
  newUser.IP = Request.UserHostAddress;
  newUser.LastDtActivity = DateTime.Now;
  newUser.Language1 = GB.User.Language;
  newUser.LastVersion = sVersion;
  newUser.FlushNextTime = false;
  
  GB.Context.SaveChanges();
  </code></pre>
  
  <p>The error occurs on SaveChanges()</p>
  
  <p>Absolutely no WSUser_Detail is being called in my code... so I wonder why should he ask for a reference that is on an object that is never called (but exists in the Entities Context).</p>
  
  <p>Any idea?</p>
  
  <p>The weird thing is that I do not had this problem before even if the code didn't seem to have changed.</p>
  
  <p>I updated the Model.edmx to be sure that it's not the cause, but it still does not work, I've checked many times and the error shouldn't come AT ALL since I do not have any WSUser_Detail object.</p>