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

Commit ec68e24

Browse files
committed
Fixed DynamicsJson to parse arrays properly
1 parent 5a9faf3 commit ec68e24

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)