From a2c9cbf045d0801e4250adc595a072f36ba8f653 Mon Sep 17 00:00:00 2001 From: scottdurow Date: Wed, 21 Oct 2015 14:04:55 +0100 Subject: [PATCH] Fixes #72 --- SparkleXrmSource/SparkleXrm/Sdk/Attribute.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SparkleXrmSource/SparkleXrm/Sdk/Attribute.cs b/SparkleXrmSource/SparkleXrm/Sdk/Attribute.cs index 1ef332d2..54b5e17a 100644 --- a/SparkleXrmSource/SparkleXrm/Sdk/Attribute.cs +++ b/SparkleXrmSource/SparkleXrm/Sdk/Attribute.cs @@ -38,7 +38,7 @@ public Attribute(string attributeName, string typeName) #region Methods public static object DeSerialise(XmlNode node,string overrideType) - { + { // Check if the value is null bool isNil = (XmlHelper.GetAttributeValue(node, "i:nil") == "true"); object value = null; @@ -65,6 +65,9 @@ public static object DeSerialise(XmlNode node,string overrideType) case AttributeTypes.Boolean_: value = (stringValue == "true"); break; + case AttributeTypes.Double_: + value = double.Parse(stringValue); + break; case AttributeTypes.Decimal_: value = decimal.Parse(stringValue); break; @@ -267,6 +270,7 @@ private static string _addNsPrefix(string type) case "DateTime": case AttributeTypes.String_: case AttributeTypes.Decimal_: + case AttributeTypes.Double_: case AttributeTypes.Boolean_: case AttributeTypes.DateTime_: case AttributeTypes.Guid_: @@ -279,7 +283,7 @@ private static string _addNsPrefix(string type) case AttributeTypes.Money: return "a:" + type; } - throw new Exception("Could add node prefix for type " + type); + throw new Exception("Could not add node prefix for type " + type); } #endregion }