title: The member with identity ' ' does not exist in the metadata collection.\r\nParameter name: identity
body: <p>I simplified the code a little while trying to debug:</p>
  
  <pre><code>[HttpPost]
      public ActionResult Register(User model)
      {
          DateTime bla = new DateTime(2012, 12, 12);
          try
          {
              User user = new User
              {
                  gid = 1,
                  cid = 1,
                  firstName = model.firstName,
                  lastName = model.lastName,
                  email = model.email,
                  username = model.username,
                  password = model.password,
                  creationDate = bla,
                  active = 1
              };
              myContext.Users.AddObject(user);
              myContext.SaveChanges();
  
          }
          catch (Exception ex)
          {
              throw ex;
          }
  
          return View();               
      }
  </code></pre>
  
  <p>The values are transmited accordingly. Users table:</p>
  
  <pre><code>[id] [int] IDENTITY(1,1) NOT NULL,
  [cid] [int] NULL,
  [gid] [int] NULL,
  [firstName] [nvarchar](100) NOT NULL,
  [lastName] [nvarchar](100) NOT NULL,
  [email] [nvarchar](max) NOT NULL,
  [username] [nvarchar](100) NOT NULL,
  [password] [nvarchar](100) NOT NULL,
  [creationDate] [datetime] NOT NULL,
  [active] [int] NOT NULL,
  </code></pre>
  
  <p>CONSTRAINT [PK_<em>Users</em>_3213E83F0AD2A005] PRIMARY KEY CLUSTERED </p>
  
  <p>I deleted all the foreign keys to be sure that nothing affects it. I am qute certain that at a previous moment it was working, but now I can not figure where the issue is.
  It crashes while performing the savechanges:</p>
  
  <pre><code>{"An error occurred while updating the entries. See the inner exception for details."}
  {"The member with identity '' does not exist in the metadata collection.\r\nParameter name: identity"}
  </code></pre>