Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
List<AuditEntry> auditEntries = new List<AuditEntry>();
using (var ctx = new EntitiesContext())
{
ctx.BulkSaveChanges(list, operation =>
{
operation.UseAudit = true;
operation.BulkOperationExecuted = bulkOperation => auditEntries.AddRange(bulkOperation.AuditEntries);
});
}
foreach (var entry in auditEntries)
{
foreach (var value in entry.Values)
{
var oldValue = value.OldValue;
var newValue = value.NewValue;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment