title: EFCore adding temporary ID by AddAsync()
body: <p>I am using EFCore 5.0.0.</p>
  <p>When I <code>AddAsync (person);</code> I should be getting a temporary <code>ID</code>, and I use this ID to add the <code>PersonId</code> for <code>School</code> (shown in code below). FInally, I will <code>SaveChangesAsync()</code> where everything will be saved. However, the <code>PersonId</code> is set to 0. I want to get the temporary <code>ID</code> stored instead. How can I do this.</p>
  <pre><code>await _dbContext.AddAsync(person);
  
  School school = mySchool;
  school.PersonId = person.Id;
  await _dbContext.AddAsync(school);
  
  await _dbContext.SaveChangesAsync();
  </code></pre>
  <p>Note: There are many <a href="https://stackoverflow.com/questions/41732585/ef-core-add-function-returns-negative-id/41737480">SO post that talks about the temporary ID</a>, but none is related to this post.</p>