title: How to get original Entity from ChangeTracker
body: <p>Is there a way to get the original Entity itself from the <code>ChangeTracker</code> (rather than just the original values)?</p>
  
  <p>If the <code>State</code> is <code>Modified</code>, then I suppose I could do this:</p>
  
  <pre><code>// Get the DbEntityEntry from the DbContext.ChangeTracker...
  
  // Store the current values
  var currentValues = entry.CurrentValues.Clone();
  
  // Set to the original values
  entry.CurrentValues.SetValues(entry.OriginalValues.Clone());
  
  // Now we have the original entity
  Foo entity = (Foo)entry.Entity;
  
  // Do something with it...
  
  // Restore the current values
  entry.CurrentValues.SetValues(currentValues);
  </code></pre>
  
  <p>But this doesn't seem very nice, and I'm sure there are problems with it that I don't know about... Is there a better way?</p>
  
  <p>I'm using Entity Framework 6.</p>