title: Entity Framework 5 - Why is Entity State "Modified" after PropertyValue is set back to Original
body: <p>i use the EF5 and don't know why a entity has the state "modified" after i set the only changed PropertyValue of this entity back to the original value. </p>
  
  <pre><code>using (TestDbContext context = new TestDbContext())
          {
              string name = context.Person.First().Name;
  
              // count is 0
              int count = context.ChangeTracker.Entries().Count(e =&gt; e.State == EntityState.Modified);
  
              // Change Value
              context.Person.First().Name = "Test";
  
              // count is 1 
              count = context.ChangeTracker.Entries().Count(e =&gt; e.State == EntityState.Modified);
  
              // Revert Value
              context.Person.First().Name = name;
  
  
              context.ChangeTracker.DetectChanges();
  
              // count is 1 
              count = context.ChangeTracker.Entries().Count(e =&gt; e.State == EntityState.Modified);
          }
  </code></pre>
  
  <p>Why? :(</p>