0

Based on how to create an audit trail with Entity framework 5 and MVC 4 question I am trying to figgure out how can I track changes in virtual/foreign objects.

On the line which compares the OriginalValues to the CurrentValues it does not include the fields for the virtual objects that where changed.

if (!object.Equals(dbEntry.OriginalValues.GetValue<object>(propertyName), dbEntry.CurrentValues.GetValue<object>(propertyName)))

Is there an easy fix for this where I can specify in my controller method that x and y virtual objects might also have been changed? Or maybe look up the original and current values of those connected to the current dbEntry in the dbEntry.State == EntityState.Modified section?

Community
  • 1
  • 1
stibay
  • 1,200
  • 6
  • 23
  • 44

0 Answers0