コード例 #1
0
        public override XmlNode XmlAppend(XmlNode node)
        {
            node.AddAttribute("key", this.Key);
            node.AddAttribute("enforce", this.Enforce);
            node.AddAttribute("description", this.Description, _def_description);
            node.AddAttribute("deleteAction", this.DeleteAction.ToString());
            this.ColumnRelationships.ResetKey(Guid.Empty, true); //no need to save this key
            node.AppendChild(ColumnRelationships.XmlAppend(node.CreateElement("crl")));
            node.AddAttribute("id", this.Id);
            node.AddAttribute("roleName", this.RoleName, _def_roleName);
            node.AddAttribute("constraintName", this.ConstraintName, _def_constraintname);

            var childTableRefNode = node.CreateElement("ct");

            if (this.ChildTableRef != null)
            {
                this.ChildTableRef.XmlAppend(childTableRefNode);
            }
            node.AppendChild(childTableRefNode);

            var parentTableRefNode = node.CreateElement("pt");

            if (this.ParentTableRef != null)
            {
                this.ParentTableRef.XmlAppend(parentTableRefNode);
            }
            node.AppendChild(parentTableRefNode);

            return(node);
        }
コード例 #2
0
ファイル: Relation.cs プロジェクト: mjl68/nHydrate
        public override void XmlAppend(XmlNode node)
        {
            var oDoc = node.OwnerDocument;

            XmlHelper.AddAttribute(node, "key", this.Key);
            XmlHelper.AddAttribute(node, "enforce", this.Enforce);

            if (this.Description != _def_description)
            {
                XmlHelper.AddAttribute(node, "description", this.Description);
            }

            var columnRelationshipsNode = oDoc.CreateElement("crl");

            ColumnRelationships.XmlAppend(columnRelationshipsNode);
            node.AppendChild(columnRelationshipsNode);

            var childTableRefNode = oDoc.CreateElement("ct");

            if (this.ChildTableRef != null)
            {
                this.ChildTableRef.XmlAppend(childTableRefNode);
            }
            node.AppendChild(childTableRefNode);

            var parentTableRefNode = oDoc.CreateElement("pt");

            if (this.ParentTableRef != null)
            {
                this.ParentTableRef.XmlAppend(parentTableRefNode);
            }
            node.AppendChild(parentTableRefNode);

            XmlHelper.AddAttribute(node, "id", this.Id);
            if (this.RoleName != _def_roleName)
            {
                XmlHelper.AddAttribute(node, "roleName", this.RoleName);
            }
            if (this.ConstraintName != _def_constraintname)
            {
                XmlHelper.AddAttribute(node, "constraintName", this.ConstraintName);
            }
            //XmlHelper.AddAttribute(node, "createdDate", _createdDate.ToString("yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture));
        }
コード例 #3
0
        public override void XmlAppend(XmlNode node)
        {
            var oDoc = node.OwnerDocument;

            node.AddAttribute("key", this.Key);
            node.AddAttribute("enforce", this.Enforce);
            node.AddAttribute("description", this.Description, _def_description);
            node.AddAttribute("deleteAction", this.DeleteAction.ToString());

            var columnRelationshipsNode = oDoc.CreateElement("crl");

            ColumnRelationships.XmlAppend(columnRelationshipsNode);
            node.AppendChild(columnRelationshipsNode);

            var childTableRefNode = oDoc.CreateElement("ct");

            if (this.ChildTableRef != null)
            {
                this.ChildTableRef.XmlAppend(childTableRefNode);
            }
            node.AppendChild(childTableRefNode);

            var parentTableRefNode = oDoc.CreateElement("pt");

            if (this.ParentTableRef != null)
            {
                this.ParentTableRef.XmlAppend(parentTableRefNode);
            }
            node.AppendChild(parentTableRefNode);

            node.AddAttribute("id", this.Id);
            if (this.RoleName != _def_roleName)
            {
                node.AddAttribute("roleName", this.RoleName);
            }
            if (this.ConstraintName != _def_constraintname)
            {
                node.AddAttribute("constraintName", this.ConstraintName);
            }
        }