public static string DropObjects(StoreItemCollection itemCollection) { var builder = new SqlScripts(); foreach (var container in itemCollection.GetItems<EntityContainer>()) { var entitySets = container.BaseEntitySets.OfType<EntitySet>().OrderBy(s => s.Name); foreach (var associationSet in container.BaseEntitySets.OfType<AssociationSet>().OrderBy(s => s.Name)) { builder.AppendDropForeignKeys(associationSet); } foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>().OrderBy(s => s.Name)) { builder.AppendDropTable(entitySet); } } return builder.GetCommandText(); }
public static string DropObjects(StoreItemCollection itemCollection) { var builder = new SqlScripts(); foreach (var container in itemCollection.GetItems <EntityContainer>()) { var entitySets = container.BaseEntitySets.OfType <EntitySet>().OrderBy(s => s.Name); foreach (var associationSet in container.BaseEntitySets.OfType <AssociationSet>().OrderBy(s => s.Name)) { builder.AppendDropForeignKeys(associationSet); } foreach (var entitySet in container.BaseEntitySets.OfType <EntitySet>().OrderBy(s => s.Name)) { builder.AppendDropTable(entitySet); } } return(builder.GetCommandText()); }