AuditEntryProperties logs unchanged property Id
AuditEntryPropertyID AuditEntryID RelationName PropertyName OldValue NewValue 50 19 NULL Id 15 15 51 19 NULL PacketState Update 2 Update 4
How do I stop it from logging unchanged ids? I do want a changed id loged
Hello @sykaufax ,
How will you know from which entity/row the Package State if the ID is not logged?
The key is the only way to retrieve from where the information modified belongs, that's why we always log the key.
Let me know if that answer correctly to your question
Best Regards,
Jonathan
I believe if you updated the parent "AuditEntry" table, you would have the info without x + 1 records in AuditEntryProperty
I.E.
AuditEntryID,EntitySetName,EntityTypeName,State,StateName,EntityKey, CreatedBy
Hello @sykaufax ,
The problem is the parent doesn't contain yet the EntityKey unless you customized it.
We hope this summer to make some MAJOR change in this features which will be way more customizable and flexible to allow to store information from different way like the one you provided.
Unfortunately, until this version is released, the key are currently stored as an AuditEntryProperties.
Let me know if that answered correctly to your question.
Best Regards,
Jonathan
Hi, I am also facing the same issue, where my data is NewValue OldValue 8 8 10 10 DeliveryExecutive DeliveryExecutive NULL NULL NULL NULL NULL NULL 8 8 26 26 24 24 False False False True
I am only saving the last row true to false, but all the fields are logged in AuditEntryProperties table.
note: I am also set "AuditManager.DefaultConfiguration.IgnorePropertyUnchanged = true;"
Hello @BabuAjith ,
This kind of error is often due to how Entity Framework is used and not our library.
For example, a modified entity is attached to the context and not retrieve from the database. So the ChangeTracker is not aware of OldValue and flag all properties as modified.
Please see the following answer: https://github.com/zzzprojects/EntityFramework-Plus/issues/8#issuecomment-222166610
Best Regards,
Jonathan
Thank you for the quick reply, I check my code.