public string GetExecutedCommands() { var sb = new StringBuilder(); var commandList = ExecutedCommands .Select(x => x.Recreate(OnCommandGetting(x.CommandText))) .Select(x => x.ExtractToText()); sb.AppendFormat("{0}", string.Join(Environment.NewLine + "----" + Environment.NewLine, commandList)); return(sb.ToString()); }
/// <summary> /// Get all commands have been executed successfully or failed /// </summary> public string GetCommands() { var sb = new StringBuilder(); var commandList = ExecutedCommands .Select(x => x.Recreate(OnCommandGetting(x.CommandText))) .Select(x => x.ExtractToText()); sb.AppendFormat("ExecutedCommands: {0}", string.Join(Environment.NewLine + "----" + Environment.NewLine, commandList)); sb.AppendLine("--------------"); var failedLogs = FailedCommands.Select(x => string.Format("Command: {0}, Error: {1}", x.Key, x.Value)); sb.AppendFormat("FailedCommands: {0}", string.Join(Environment.NewLine + "----" + Environment.NewLine, failedLogs)); sb.AppendLine(); return(sb.ToString()); }