ChangeTracker.Entries() CurrentValue equals OriginalValue in EF7
<p>I have a issue in EF7/asp.Net Core application. In my context I create a method Save:</p>

<pre><code>    public int Save()
    {
        ChangeTracker.DetectChanges();
        var modifiedEntities = ChangeTracker.Entries()
            .Where(p =&gt; p.State == EntityState.Modified || p.State == EntityState.Added || p.State == EntityState.Deleted || p.State == EntityState.Modified || p.State == EntityState.Detached).ToList();
        var now = DateTime.UtcNow;

        foreach (var change in modifiedEntities)
        {
            var entityName = change.Entity.GetType().Name;
            var primaryKeyValue = GetPrimaryKeyValue(change.Entity);
            foreach (var prop in change.Entity.GetType().GetTypeInfo().DeclaredProperties)
            {
                if (!prop.GetGetMethod().IsVirtual)
                {
                    var currentValue = change.Property(prop.Name).CurrentValue;
                    var originalValue = change.Property(prop.Name).OriginalValue;
                    if (originalValue.ToString() != currentValue.ToString())
                    {
                        var changeLoged = new ChangeLog
                        {
                            PropertyName = prop.Name,
                            EntityName = entityName,
                            PrimaryKeyValue = primaryKeyValue,
                            DateChange = now,
                            OldValue = originalValue.ToString(),
                            NewValue = currentValue.ToString(),
                            ChangedBy = "test"
                        };
                        ChangeLog.Add(changeLoged);
                    }
                }
            }
        }
        return base.SaveChanges();
    }
</code></pre>

<p>and method GetPrimaryKeyValue:</p>

<pre><code>protected virtual int GetPrimaryKeyValue&lt;T&gt;(T entity)
    {
        var test = entity;
        var test2 = test.GetType();
        var keyName = this.Model.FindEntityType(test2).FindPrimaryKey().Properties
            .Select(x =&gt; x.Name).Single();
        var result = (int)entity.GetType().GetProperty(keyName).GetValue(entity, null);
        if (result &lt; 0)
            return -1;

        return result;
    }
</code></pre>

<p>Unfortunatlly the change.Property(prop.Name).CurrentValue always equals OriginalValue, so the if 
<code>originalValue.ToString() != currentValue.ToString()</code></p>

<p>always return false.</p>