public static IList <DbObject> GetObjectsOfType(this DatabaseSource databaseSource, TableType tableType) { Argument.IsNotNull(() => databaseSource); var dataSourceCopy = new DatabaseSource(databaseSource.ToString()) { TableType = tableType }; var gateway = dataSourceCopy.CreateGateway(); return(gateway?.GetObjects() ?? new List <DbObject>()); }
private void Initialize() { if (_isInitialized) { return; } try { _gateway = _databaseSource.CreateGateway(); } catch (Exception ex) { Log.Error(ex, $"Failed to initialize reader for data source '{Source}'"); AddValidationError($"Filed to initialize reader: '{ex.Message}'"); } finally { _isInitialized = true; } }