I had this working originally, however it seems it has stopped working. The value of originalValue and currentValue always seem to be the same.
Here's my code
Public Overrides Function SaveChanges() As Integer
Dim modifiedEntities = ChangeTracker.Entries.ToList
For Each ent As DbEntityEntry In modifiedEntities
If ent.State = EntityState.Modified Then
Dim type = ent.Entity.GetType.Name
Dim primaryKey = GetPrimaryKeyValue(ent)
Dim jo As New JObject
For Each prop In ent.OriginalValues.PropertyNames
Dim originalValue = ent.OriginalValues(prop).ToString
Dim currentValue = ent.CurrentValues(prop).ToString
If originalValue <> currentValue Then
jo.Add(New JProperty(prop, currentValue))
End If
Next
End If
Next
Return MyBase.SaveChanges()
End Function
I know that nothing actually gets done with the JSON object, however when stepping through the code the originalValue is always the same as the currentValue if even the value has been updated.