Exemplo n.º 1
0
        public override async Task <bool> OpenAsync(CancellationToken cancellationToken, bool errorsExpected = false)
        {
            var result = await base.OpenAsync(cancellationToken, errorsExpected);

            if (result)
            {
                MySqlConnectionInfo.SetServerVersion((MySqlConnection)DbConnection, _serviceProvider);

                if (_mySqlOptionsExtension.UpdateSqlModeOnOpen && _mySqlOptionsExtension.NoBackslashEscapes)
                {
                    await AppendToSqlModeAsync(NoBackslashEscapes);
                }
            }

            return(result);
        }
Exemplo n.º 2
0
        public override bool Open(bool errorsExpected = false)
        {
            var result = base.Open(errorsExpected);

            if (result)
            {
                MySqlConnectionInfo.SetServerVersion((MySqlConnection)DbConnection, _serviceProvider);

                if (_mySqlOptionsExtension.UpdateSqlModeOnOpen && _mySqlOptionsExtension.NoBackslashEscapes)
                {
                    AppendToSqlMode(NoBackslashEscapes);
                }
            }

            return(result);
        }