Beispiel #1
0
        public void PreloadDroppedDependencies(Catalog droppedCatalog)
        {
            if (Catalog.ObjectCount(droppedCatalog) == 0)
            {
                return;
            }

            DroppedUserTables.UnionWith(
                droppedCatalog.Schemas.Select(
                    schema => schema.UserTables)
                .SelectMany(
                    userTables => userTables.Select(
                        userTable => userTable.Namespace)));

            DroppedForeignKeys.UnionWith(droppedCatalog.Schemas.SelectMany(p => p.UserTables.SelectMany(q => q.ForeignKeys.Select(r => r.Namespace))));
        }
Beispiel #2
0
        public void PreloadDroppedDependencies(UserTable droppedUserTable)
        {
            DroppedUserTables.Add(droppedUserTable.Namespace);

            if (droppedUserTable.Catalog != null)
            {
                DroppedForeignKeys.UnionWith(droppedUserTable.Catalog.Schemas.SelectMany(p => p.UserTables.SelectMany(q => q.ForeignKeys.Select(r => r.Namespace))));
                return;
            }

            if (UserTable.ObjectCount(droppedUserTable) == 0)
            {
                return;
            }

            DroppedForeignKeys.UnionWith(
                droppedUserTable.ForeignKeys.Select(
                    foreignKey => foreignKey.Namespace));
        }
Beispiel #3
0
        public void PreloadDroppedDependencies(Schema droppedSchema)
        {
            if (Schema.ObjectCount(droppedSchema) == 0)
            {
                return;
            }

            DroppedUserTables.UnionWith(
                droppedSchema.UserTables.Select(
                    userTable => userTable.Namespace));

            if (droppedSchema.Catalog != null)
            {
                DroppedForeignKeys.UnionWith(droppedSchema.Catalog.Schemas.SelectMany(p => p.UserTables.SelectMany(q => q.ForeignKeys.Select(r => r.Namespace))));
                return;
            }

            DroppedForeignKeys.UnionWith(
                droppedSchema.UserTables.Select(
                    userTable => userTable.ForeignKeys)
                .SelectMany(
                    foreignKeys => foreignKeys.Select(
                        foreignKey => foreignKey.Namespace)));
        }