private static void IsKeyProperty( List <EdmProperty> roleProperties, RelationshipEndMember roleElement, out bool isKeyProperty, out bool areAllPropertiesNullable, out bool isAnyPropertyNullable, out bool isSubsetOfKeyProperties) { isKeyProperty = true; areAllPropertiesNullable = true; isAnyPropertyNullable = false; isSubsetOfKeyProperties = true; if (roleElement.GetEntityType().GetValidKey().Count <EdmProperty>() != roleProperties.Count <EdmProperty>()) { isKeyProperty = false; } for (int index = 0; index < roleProperties.Count <EdmProperty>(); ++index) { if (isSubsetOfKeyProperties && !roleElement.GetEntityType().GetValidKey().ToList <EdmProperty>().Contains(roleProperties[index])) { isKeyProperty = false; isSubsetOfKeyProperties = false; } bool nullable = roleProperties[index].Nullable; areAllPropertiesNullable &= nullable; isAnyPropertyNullable |= nullable; } }
internal void WriteAssociationEndElementHeader(RelationshipEndMember associationEnd) { DebugCheck.NotNull(associationEnd); _xmlWriter.WriteStartElement(XmlConstants.End); _xmlWriter.WriteAttributeString(XmlConstants.Role, associationEnd.Name); var typeName = associationEnd.GetEntityType().Name; _xmlWriter.WriteAttributeString( XmlConstants.TypeAttribute, GetQualifiedTypeName(XmlConstants.Self, typeName)); _xmlWriter.WriteAttributeString( XmlConstants.Multiplicity, RelationshipMultiplicityConverter.MultiplicityToString(associationEnd.RelationshipMultiplicity)); }
internal void WriteAssociationEndElementHeader(RelationshipEndMember associationEnd) { this._xmlWriter.WriteStartElement("End"); this._xmlWriter.WriteAttributeString("Role", associationEnd.Name); this._xmlWriter.WriteAttributeString("Type", XmlSchemaWriter.GetQualifiedTypeName("Self", associationEnd.GetEntityType().Name)); this._xmlWriter.WriteAttributeString("Multiplicity", RelationshipMultiplicityConverter.MultiplicityToString(associationEnd.RelationshipMultiplicity)); }