Exemple #1
0
        public List<Schema> GetSchemas( Microsoft.SqlServer.Management.Smo.Database database )
        {
            var schemas = new List<Schema>();
            foreach (Microsoft.SqlServer.Management.Smo.Schema schema in database.Schemas)
            {
                var bimlSchema = new Schema
                    {
                        DatabaseName = database.Name,
                        Name = schema.Name,
                        Owner = schema.Owner,
                    };

                var annotations = GetAnnotations( schema.ExtendedProperties );
                if (annotations.Any())
                    bimlSchema.Annotations = annotations;

                schemas.Add( bimlSchema );
            }
            return schemas;
        }