Esempio n. 1
0
        public XElement ToXElement()
        {
            XElement OElement = new XElement("Column",
                                             new XAttribute("Name", Name),
                                             new XAttribute("DataType", DataType),
                                             new XAttribute("MaxLength", MaxLength),
                                             new XAttribute("Nullable", Nullable),
                                             new XAttribute("DefaultValue", DefaultValue ?? ""),
                                             new XAttribute("PrimaryKey", PrimaryKey),
                                             new XAttribute("Required", Required),
                                             new XAttribute("AutoIncrement", AutoIncrement));

            foreach (String OKey in FAdddionalMetadata.Keys)
            {
                OElement.Add(new XAttribute(OKey, FAdddionalMetadata[OKey]));
            }
            XElement ORelationships = new XElement("DatabaseRelationships");

            OElement.Add(ORelationships);
            foreach (Database ODatabase in FDatabaseRelationships.Values)
            {
                ORelationships.Add(ODatabase.ToRelationshipXElement());
            }
            return(OElement);
        }
Esempio n. 2
0
        public XElement ToXElement()
        {
            XElement OElement = new XElement("Table",
                                             new XAttribute("Schema", SchemaName),
                                             new XAttribute("Name", TableName),
                                             new XAttribute("Replicated", IsReplicated),
                                             new XAttribute("CreatedDate", CreatedDate),
                                             new XAttribute("LastModifiedDate", LastModifiedDate));

            foreach (String OKey in FAdddionalMetadata.Keys)
            {
                OElement.Add(new XAttribute(OKey, FAdddionalMetadata[OKey]));
            }
            XElement ORelationships = new XElement("DatabaseRelationships");

            OElement.Add(ORelationships);
            foreach (Database ODatabase in FDatabaseRelationships.Values)
            {
                ORelationships.Add(ODatabase.ToRelationshipXElement());
            }
            foreach (Column OColumn in FColumns.Values)
            {
                OElement.Add(OColumn.ToXElement());
            }
            return(OElement);
        }