zzzprojects / Dapper-Plus

Dapper Plus - High-Efficient Bulk Actions (Insert, Update, Delete, and Merge) for .NET
https://dapper-plus.net/
383 stars 85 forks source link

It is not possible to disaple auditing for table #76

Closed ElenaShlykova closed 3 years ago

ElenaShlykova commented 3 years ago

Hello! I have a main table that should be audited. This table has one-to-many reference to a child table and changes in the child table should not be audited. I update data in these tables in the single query with BulkUpdate command. I added AuditMode(AuditModeType.ExcludeAll) to the mapping for the child table but I still receive AuditEntry for the child table just without values. I need to completely exclude the child table from auditing, is it possible?

JonathanMagnan commented 3 years ago

Thank you for reporting,

We will look at it as it seems true to be currently impossible or very hard.

If you need a very quick solution, you can try this one, I'm not sure if it will have a side impact however:

DapperPlusManager.Entity<YouEntityTypeToExclude>().UseBulkOptions(x => x.BulkOperationExecuting = operation => operation.UseAudit = false);

Best Regards,

Jon

ElenaShlykova commented 3 years ago

Thank you! It works

JonathanMagnan commented 3 years ago

Awesome @ElenaShlykova

Don't hesitate to contact us with any questions or further assistance!

Best regards,

Jon