private static IDictionary <string, TableMetaData> Load(DbConnection connection, ICollection <string> tables, string databaseType)
        {
            using (connection)
            {
                connection.Open();
                IDictionary <string, TableMetaData> result = new Dictionary <string, TableMetaData>();
                foreach (var table in tables)
                {
                    result.Add(table, new TableMetaData(ColumnMetaDataLoader.Load(connection, table, databaseType), IndexMetaDataLoader.Load(connection, table, databaseType)));
                }

                return(result);
            }
        }
Example #2
0
 public static TableMetaData Load(IDataSource dataSource, string table, string databaseType)
 {
     using (var connection = dataSource.CreateConnection())
     {
         connection.Open();
         return(new TableMetaData(ColumnMetaDataLoader.Load(connection, table, databaseType), IndexMetaDataLoader.Load(connection, table, databaseType)));
     }
 }