EntityFrameworkCore.Triggered icon indicating copy to clipboard operation
EntityFrameworkCore.Triggered copied to clipboard

Detect exactly which column is changed

Open saadsaeed01 opened this issue 2 years ago • 1 comments

Hello

I want to create an audit for those properties whose old and new values are different. Is there a way to detect which property is changed on the AfterSave method?

Waiting for your answer!

Best Wishes Saad

saadsaeed01 avatar Sep 01 '22 11:09 saadsaeed01

@saadsaeed01 An audited feature is implemented as part of an example of this project, please see: https://github.com/koenbeuk/EntityFrameworkCore.Triggered/blob/master/samples/3%20-%20StudentManagerAspNetCore/Triggers/Traits/Audited/CreateAuditRecord.cs

This trigger records an audit record that includes a string with all properties that have changed in that update (including old value and new value). You can use this as an example for implementing your own auditing requirements

koenbeuk avatar Sep 01 '22 22:09 koenbeuk

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 03 '22 06:11 stale[bot]