Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 7cd06d3

Browse files
committed
Merge pull request #442 from alercunha/master
Fixed DynamicsJson to parse arrays properly
2 parents 5a9faf3 + ec68e24 commit 7cd06d3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ServiceStack.Text/Pcl.Dynamic.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,15 @@ private bool YieldMember(string name, out object result)
142142
result = Deserialize(json);
143143
return true;
144144
}
145+
else if (json.TrimStart(' ').StartsWith("[", StringComparison.Ordinal))
146+
{
147+
result = JsonArrayObjects.Parse(json).Select(a =>
148+
{
149+
var hash = a.ToDictionary<KeyValuePair<string, string>, string, object>(entry => entry.Key, entry => entry.Value);
150+
return new DynamicJson(hash);
151+
}).ToArray();
152+
return true;
153+
}
145154
result = json;
146155
return _hash[name] == result;
147156
}

0 commit comments

Comments
 (0)