title: EF Core Add function returns negative id
body: <p>I noticed a weird thing today when I tried to save an entity and return its id in EF Core </p>
  
  <p>Before:
  <a href="https://i.stack.imgur.com/gdLcO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gdLcO.png" alt="The Id is 0 before it was added to database"></a>
  After:
  <a href="https://i.stack.imgur.com/C8YKv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/C8YKv.png" alt="Now the id has been changed to a negative value"></a></p>
  
  <p>I was thinking about if it was before calling saveChanges() but it works with another entity with a similar setup.</p>
  
  <p>ps: I use unit of work to save all changes at the end.</p>
  
  <p>What was the reason?</p>