LinqToSql Plus Logging

Log

Gets or sets an action to log all database events as soon as they happen.

StringBuilder logger = new StringBuilder();

context.BulkMerge(options =>
{
	options.Log += s => logger.AppendLine(s);
});

UseLogDump

Gets or sets if all log related to database event should be stored in a LogDump properties.

StringBuilder logDump;

context.BulkMerge(options =>
{
	options.UseLogDump = true;
	options.BulkOperationExecuted = bulkOperation => logDump = bulkOperation.LogDump;
});

LogDump

Gets all logged database event when UseLogDump is enabled.

StringBuilder logDump;

context.BulkMerge(options =>
{
	options.UseLogDump = true;
	options.BulkOperationExecuted = bulkOperation => logDump = bulkOperation.LogDump;
});



Prime Library