Entity Framework: Setting update timestamp

前端 未结 4 1525
囚心锁ツ
囚心锁ツ 2020-12-29 13:14

All of our database tables have UpdateUserID and UpdateTS. I\'d like to have this set if my entity has changes. Is there a way I can have this update on the spot condition

4条回答
  •  礼貌的吻别
    2020-12-29 13:36

    You should be able to handle the SavingChanges event (example here) and perform logic as outlined by @sander

提交回复
热议问题