Exemple #1
0
        internal PayloadSimpleProperty ParseSimpleProperty(PayloadObject parent, XElement xmlData)
        {
            PayloadSimpleProperty payloadProperty = new PayloadSimpleProperty(parent);
            payloadProperty.Name = xmlData.Name.LocalName;
            payloadProperty.Value = xmlData.Value;

            XAttribute nullAttribute = xmlData.Attribute(m + "null");
            if (nullAttribute != null && nullAttribute.Value == "true")
            {
                payloadProperty.Value = null;
                payloadProperty.IsNull = true;
            }

            XAttribute typeAttribute = xmlData.Attribute(m + "type");
            if (typeAttribute != null)
                payloadProperty.Type = typeAttribute.Value;

            return payloadProperty;
        }
Exemple #2
0
        internal PayloadSimpleProperty parseSimpleObject(PayloadObject parent, JSField field)
        {
            PayloadSimpleProperty payloadProperty = new PayloadSimpleProperty(parent);
            payloadProperty.Name = field.Name;

            object val = field.GetValue(field);

            if (val is System.DBNull)
            {
                payloadProperty.Value = null;
                payloadProperty.Type = null;
                payloadProperty.IsNull = true;
            }
            else
            {
                payloadProperty.Type = AstoriaUnitTests.Data.TypeData.FindForType(val.GetType()).GetEdmTypeName();
                payloadProperty.Value = ConvertJsonValue(val);
                payloadProperty.IsNull = false;
            }

            return payloadProperty;
        }
Exemple #3
0
 internal PayloadObject ParseUriNode(XElement node)
 {
     PayloadObject po = new PayloadObject(this);
     PayloadSimpleProperty property = new PayloadSimpleProperty(po);
     property.Value = node.Value;
     property.Name = node.Name.LocalName;
     po.Name = node.Name.LocalName;
     po.PayloadProperties.Add(property);
     return po;
 }