Last active
January 12, 2017 03:02
-
-
Save JonathanMagnan/fd89c3c6ffaf836198d1a84a6cc3d916 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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