Fix debug && add trim

This commit is contained in:
Dmitry Mamontov 2015-02-02 15:51:09 +03:00
parent 867de6b357
commit f927e89f9d

View File

@ -70,15 +70,14 @@ namespace RetailCrm.Extra
if (valueObj.GetType() == typeof(JArray)) if (valueObj.GetType() == typeof(JArray))
{ {
string tmpValue = JsonConvert.SerializeObject(((JArray)valueObj).ToArray<dynamic>()); string tmpValue = JsonConvert.SerializeObject(((JArray)valueObj).ToArray<dynamic>());
value = tmpValue.Replace("[", "{"); char[] charsToTrim = { '[', ' ', ']'};
value = value.Replace("]", "}"); value = tmpValue.Trim(charsToTrim);
} }
else else
{ {
value = valueObj.ToString(); value = valueObj.ToString();
} }
System.Console.WriteLine(value);
System.Console.ReadLine();
if (value != "") if (value != "")
{ {
if (valueObj.GetType() == typeof(JObject) || valueObj.GetType() == typeof(JArray)) if (valueObj.GetType() == typeof(JObject) || valueObj.GetType() == typeof(JArray))