This is a migrated thread and some comments may be shown as answers.

Audit of save of persistent object

1 Answer 58 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Grant Drury-Green
Top achievements
Rank 1
Grant Drury-Green asked on 05 Jul 2012, 10:36 AM
I have a requirement to audit changes to persistent objects. I have tried to use [database context].Events.Changed but the event seems to be triggered for each property that is changed.

I need to capture an event which aggregates any and all changes made to a persistent object. This can be either immediately before, or immediately after it has actually been written to the data store.

Is there any current way to achieve this? Or can anyone suggest a possible method? I'm really trying to avoid DB triggers...

1 Answer, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 05 Jul 2012, 05:09 PM
Hi Grant,

 You should consider using the 'OpenAccessContextBase.GetChanges()' method before SaveChanges. This will give you a consolidated list of changes that will be applied during SaveChanges.You can then call 'GetInsert/Updates/Deletes for a particular type to get further details.

Do get back in case you need further assistance.

Greetings,
Ady
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
Tags
Development (API, general questions)
Asked by
Grant Drury-Green
Top achievements
Rank 1
Answers by
Ady
Telerik team
Share this question
or