private string CreateProcedureCommandScriptText(Func <MySqlCommand> BuildCommand, string procName) { var str1 = $"Command {procName} for table {tableName.Quoted().ToString()}"; var str = CreateProcedureCommandText(BuildCommand(), procName); return(MyTableSqlBuilder.WrapScriptTextWithComments(str, str1)); }
private string CreateProcedureCommandScriptText <T>(Func <T, MySqlCommand> BuildCommand, string procName, T t, DbConnection connection, DbTransaction transaction) { var str1 = $"Command {procName} for table {tableName.Quoted().ToString()}"; var str = CreateProcedureCommandText(BuildCommand(t), procName); return(MyTableSqlBuilder.WrapScriptTextWithComments(str, str1)); }
private string CreateProcedureCommandScriptText <T>(Func <T, MySqlCommand> BuildCommand, string procName, T t) { bool alreadyOpened = connection.State == ConnectionState.Open; try { if (!alreadyOpened) { connection.Open(); } var str1 = $"Command {procName} for table {tableName.Quoted().ToString()}"; var str = CreateProcedureCommandText(BuildCommand(t), procName); return(MyTableSqlBuilder.WrapScriptTextWithComments(str, str1)); } catch (Exception ex) { Debug.WriteLine($"Error during CreateProcedureCommand : {ex}"); throw; } finally { if (!alreadyOpened && connection.State != ConnectionState.Closed) { connection.Close(); } } }