示例#1
0
        public static MySqlProviderAdapter GetInstance(string name)
        {
            if (name == ProviderName.MySqlConnector)
            {
                if (_mysqlConnectorInstance == null)
                {
                    lock (_mysqlConnectorSyncRoot)
                        if (_mysqlConnectorInstance == null)
                        {
                            _mysqlConnectorInstance = MySqlConnector.CreateAdapter();
                        }
                }

                return(_mysqlConnectorInstance);
            }
            else
            {
                if (_mysqlDataInstance == null)
                {
                    lock (_mysqlDataSyncRoot)
                        if (_mysqlDataInstance == null)
                        {
                            _mysqlDataInstance = MySqlData.CreateAdapter();
                        }
                }

                return(_mysqlDataInstance);
            }
        }