Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement