How to Use ChangeTracker.Clear in EF Core
A DbContext remembers every entity it has loaded or been told about, until you say otherwise. ChangeTracker.Clear() makes it forget all of them, including changes you haven't saved. That's the fix for one nasty retry bug, and useful in a couple of other places.
