Entity Framework DbContext SaveChanges() OriginalValue Incorrect

前端 未结 5 982
孤街浪徒
孤街浪徒 2020-12-03 21:51

I am trying to implement an AuditLog using EF 4.1, by overriding the SaveChanges() method as discussed in the following places:

  • http://jmdority.wordpress.com/2
5条回答
  •  生来不讨喜
    2020-12-03 22:50

    If you change

    dbEntry.OriginalValues.GetValue(propertyName);
    
    
    

    to

    dbEntry.GetDatabaseValues().GetValue(propertyName);
    
    
    

    then that works.

    提交回复
    热议问题