Esempio n. 1
0
        /// <summary>
        /// Check if we need to create the stored procedure
        /// </summary>
        public bool NeedToCreateProcedure(DbCommandType commandType)
        {
            if (connection.State != ConnectionState.Open)
            {
                throw new ArgumentException("Here, we need an opened connection please");
            }

            var commandName = this.sqlObjectNames.GetCommandName(commandType);

            return(!MySqlManagementUtils.ProcedureExists(connection, transaction, commandName));
        }
Esempio n. 2
0
        /// <summary>
        /// Check if we need to create the stored procedure
        /// </summary>
        public bool NeedToCreateProcedure(DbCommandType commandType, DbBuilderOption option)
        {
            if (connection.State != ConnectionState.Open)
            {
                throw new ArgumentException("Here, we need an opened connection please");
            }

            var commandName = this.sqlObjectNames.GetCommandName(commandType);

            if (option.HasFlag(DbBuilderOption.CreateOrUseExistingSchema))
            {
                return(!MySqlManagementUtils.ProcedureExists(connection, transaction, commandName));
            }

            return(false);
        }