예제 #1
0
        protected override void OnSetup()
        {
            ICollection <string> settingsKeys = ((IDictionary <string, object>)Settings).Keys;

            if (settingsKeys.Contains("ConnectionString"))
            {
                if (settingsKeys.Contains("ProviderName"))
                {
                    _connectionProvider = ProviderHelper.GetProviderByConnectionString(Settings.ConnectionString,
                                                                                       Settings.ProviderName);
                }
                else
                {
                    _connectionProvider = ProviderHelper.GetProviderByConnectionString(Settings.ConnectionString);
                }
            }
            else if (settingsKeys.Contains("Filename"))
            {
                _connectionProvider = ProviderHelper.GetProviderByFilename(Settings.Filename);
            }
            else if (settingsKeys.Contains("ConnectionName"))
            {
                _connectionProvider = ProviderHelper.GetProviderByConnectionName(Settings.ConnectionName);
            }
            _schema           = DatabaseSchema.Get(_connectionProvider, _providerHelper);
            _relatedFinder    = new Lazy <AdoAdapterRelatedFinder>(CreateRelatedFinder);
            _commandOptimizer = ProviderHelper.GetCustomProvider <CommandOptimizer>(_connectionProvider) ??
                                new CommandOptimizer();
        }
예제 #2
0
        protected override void OnSetup()
        {
            var settingsKeys = ((IDictionary <string, object>)Settings).Keys;

            if (settingsKeys.Contains("ConnectionString"))
            {
                _connectionProvider = ProviderHelper.GetProviderByConnectionString(Settings.ConnectionString);
            }
            else if (settingsKeys.Contains("Filename"))
            {
                _connectionProvider = ProviderHelper.GetProviderByFilename(Settings.Filename);
            }
            _schema        = DatabaseSchema.Get(_connectionProvider);
            _relatedFinder = new Lazy <AdoAdapterRelatedFinder>(CreateRelatedFinder);
        }