Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonathanMagnan/fdbdc0a81fd02398c5cd2d76bacd02df to your computer and use it in GitHub Desktop.
Save JonathanMagnan/fdbdc0a81fd02398c5cd2d76bacd02df to your computer and use it in GitHub Desktop.
StringBuilder logger = new StringBuilder();
using (var ctx = new EntitiesContext())
{
ctx.BulkSaveChanges(operation =>
{
operation.Log += s => logger.AppendLine(s);
});
}
StringBuilder logDump;
using (var ctx = new EntitiesContext())
{
ctx.BulkSaveChanges(operation =>
{
operation.UseLogDump = true;
operation.BulkOperationExecuting = bulkOperation => logDump = bulkOperation.LogDump;
});
}
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