private EntityTargetAttribute ParseTargetAttributes(XElement element)
        {
            var name                = element.Attribute(XmlMetadataSchema.AttributeAttributeName).Value;
            var type                = element.Attribute(XmlMetadataSchema.AttributeAttributeType).Value;
            var isRequired          = element.Attribute(XmlMetadataSchema.BaseDisplayableRequiredAttribute).ValueOrDefault(false);
            var connectorParameters = XmlConnectorParametersParser.Parse(element);
            var targetPath          = element.Attribute(XmlMetadataSchema.TargetPathAttribute).ValueOrDefault("");

            return(new EntityTargetAttribute(name, type, isRequired, connectorParameters, targetPath));
        }
예제 #2
0
            /// <summary>
            ///     Deseriliazes the specified XML element to its corresponding
            ///     <seealso cref="EntityAttribute"/> representation.
            /// </summary>
            /// <param name="attribute">The XML attribute to parse.</param>
            private static EntityAttribute ParseAttribute(XElement attribute)
            {
                var name                = attribute.Attribute(XmlMetadataSchema.AttributeAttributeName).Value;
                var type                = attribute.Attribute(XmlMetadataSchema.AttributeAttributeType).Value;
                var isRequired          = attribute.Attribute(XmlMetadataSchema.BaseDisplayableRequiredAttribute).ValueOrDefault(false);
                var query               = attribute.Attribute(XmlMetadataSchema.AttributeQuery).ValueOrDefault((string)null);
                var isAutoGenerated     = attribute.Attribute(XmlMetadataSchema.AttributeAttributeAutoGenerated).ValueOrDefault(false);
                var connectorParameters = XmlConnectorParametersParser.Parse(attribute);

                return(new EntityAttribute(name, type, isRequired, isAutoGenerated, connectorParameters, query));
            }
예제 #3
0
        /// <summary>
        ///     Deseriliazes the specified XML element to its corresponding
        ///     <seealso cref="EntityMetadata"/> representation.
        /// </summary>
        /// <param name="entity">The `entity` element to be deserialized.</param>
        private static EntityMetadata ParseEntity(XElement entity)
        {
            var name            = entity.Attribute(XmlMetadataSchema.EntityAttributeName).Value;
            var idAttributeName = entity.Attribute(XmlMetadataSchema.EntityAttributeIdAttribute).Value;
            var whereClause     = entity.Attribute(XmlMetadataSchema.EntityAttributeWhereClause).ValueOrDefault((string)null);
            var parentEntity    = entity.Attribute(XmlMetadataSchema.EntityAttributeParentEntity).ValueOrDefault((string)null);
            var associations    = XmlAssociationsParser.Parse(entity);

            return(new EntityMetadata(name,
                                      XmlSchemaParser.Parse(name, entity, idAttributeName, associations.Item2, whereClause, parentEntity),
                                      associations.Item1,
                                      XmlConnectorParametersParser.Parse(entity)
                                      ));
        }
 private ConnectorParameters ParseConnectorParameters(XElement entityElement)
 {
     return(XmlConnectorParametersParser.Parse(entityElement));
 }