internal static string CreateObjectScript(AssociationSet associationSet)
        {
            JetCreateDatabaseSqlGenerator builder = new JetCreateDatabaseSqlGenerator();

            builder.AppendCreateForeignKeys(associationSet);
            return(builder.GetCommandText());
        }
        internal static string CreateObjectsScript(StoreItemCollection itemCollection)
        {
            JetCreateDatabaseSqlGenerator builder = new JetCreateDatabaseSqlGenerator();

            foreach (EntityContainer container in itemCollection.GetItems <EntityContainer>())
            {
                var entitySets = container.BaseEntitySets.OfType <EntitySet>().OrderBy(s => s.Name);

                foreach (EntitySet entitySet in container.BaseEntitySets.OfType <EntitySet>().OrderBy(s => s.Name))
                {
                    builder.AppendCreateTable(entitySet);
                    builder.AppendSql(";");
                }

                foreach (AssociationSet associationSet in container.BaseEntitySets.OfType <AssociationSet>().OrderBy(s => s.Name))
                {
                    builder.AppendCreateForeignKeys(associationSet);
                    builder.AppendSql(";");
                }
            }
            return(builder.GetCommandText());
        }