Exemplo n.º 1
0
        protected bool IsDifferent(EdmReferentialConstraintPropertyPair a, EdmReferentialConstraintPropertyPair b, PropertyPath path)
        {
            var anyDifferent = false;

            anyDifferent |= IsDifferent(a.DependentProperty, b.DependentProperty, path + "DependentProperty");
            anyDifferent |= IsDifferent(a.PrincipalProperty, b.PrincipalProperty, path + "PrincipalProperty");
            return(anyDifferent);
        }
        internal void WriteReferentialConstraintPair(EdmReferentialConstraintPropertyPair pair)
        {
            this.xmlWriter.WriteStartElement(CsdlConstants.Element_ReferentialConstraint);

            // <EntityType Name="Product">
            //   ...
            //   <Property Name="CategoryID" Type="Edm.String" Nullable="false"/>
            //  <NavigationProperty Name="Category" Type="Self.Category" Nullable="false">
            //     <ReferentialConstraint Property="CategoryID" ReferencedProperty="ID" />
            //   </NavigationProperty>
            // </EntityType>
            // the above CategoryID is DependentProperty, ID is PrincipalProperty.
            this.WriteRequiredAttribute(CsdlConstants.Attribute_Property, pair.DependentProperty.Name, EdmValueWriter.StringAsXml);
            this.WriteRequiredAttribute(CsdlConstants.Attribute_ReferencedProperty, pair.PrincipalProperty.Name, EdmValueWriter.StringAsXml);
            this.WriteEndElement();
        }
Exemplo n.º 3
0
 internal abstract void WriteReferentialConstraintPair(EdmReferentialConstraintPropertyPair pair);