Last active
January 12, 2017 03:02
-
-
Save JonathanMagnan/fdbdc0a81fd02398c5cd2d76bacd02df 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
StringBuilder logger = new StringBuilder(); | |
using (var ctx = new EntitiesContext()) | |
{ | |
ctx.BulkSaveChanges(operation => | |
{ | |
operation.Log += s => logger.AppendLine(s); | |
}); | |
} |
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
StringBuilder logDump; | |
using (var ctx = new EntitiesContext()) | |
{ | |
ctx.BulkSaveChanges(operation => | |
{ | |
operation.UseLogDump = true; | |
operation.BulkOperationExecuting = bulkOperation => logDump = bulkOperation.LogDump; | |
}); | |
} |
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
StringBuilder logDump; | |
using (var ctx = new EntitiesContext()) | |
{ | |
ctx.BulkSaveChanges(operation => | |
{ | |
operation.UseLogDump = true; | |
operation.BulkOperationExecuting = bulkOperation => logDump = bulkOperation.LogDump; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment