Exemplo n.º 1
0
        public List <SqlTableSchema> GetSqlTableSchemas(SqlConnection sqlConnection, SqlTableSchema schemaRestriction)
        {
            if (sqlConnection == null)
            {
                throw new ArgumentNullException(nameof(sqlConnection));
            }
            if (schemaRestriction == null)
            {
                throw new ArgumentNullException(nameof(schemaRestriction));
            }

            using (var schema = sqlConnection.GetSchema(SqlSchemaCollection.Tables, schemaRestriction))
            {
                return(schema.AsEnumerable().Select(SqlSchemaFactory.Create <SqlTableSchema>).ToList());
            }
        }
Exemplo n.º 2
0
 public static List <SqlTableSchema> GetSqlTableSchemas(this SqlConnection sqlConnection, SqlTableSchema schemaRestriction)
 {
     return(SqlSchemaReader.GetSqlTableSchemas(sqlConnection, schemaRestriction));
 }
Exemplo n.º 3
0
 public static List <SqlTableSchema> GetSqlTableSchemas(this ISqlSchemaReader reader, string connectionString, SqlTableSchema schemaRestriction)
 {
     using (var sqlConnection = new SqlConnection(connectionString).Then(c => c.Open()))
     {
         return(reader.GetSqlTableSchemas(sqlConnection, schemaRestriction));
     }
 }