title: "Cannot insert explicit value for identity column in table 'x' when IDENTITY_INSERT is set to OFF" - inserting record with nested custom object
body: <p>I get the error &quot;Cannot insert explicit value for identity column in table 'UserPermission' when IDENTITY_INSERT is set to OFF&quot; trying to insert a record as follows:</p>
  <pre><code>dbContext.User.Add(someUser);
  dbContext.SaveChanges();
  </code></pre>
  <p>That being said, the User file has the custom class UserPermission as one of its parameters, and <code>someUser</code>'s UserPermission is not null and has a set ID parameter. Why does this happen and is it possible to avoid getting this error without having to explicitly add a UserPermissionID foreign key parameter in my User model and setting the UserPermission parameter to null?</p>
  <p>Thanks in advance.</p>