-Added Merge to LINQ to JSON

This commit is contained in:
James Newton-King
2014-08-01 21:27:38 +12:00
parent 490895716c
commit 5fc738247f
22 changed files with 796 additions and 4 deletions
+10
View File
@@ -145,6 +145,16 @@ namespace Newtonsoft.Json.Linq
return (Value == item);
}
internal override void MergeItem(object content, JsonMergeSettings settings)
{
JProperty p = content as JProperty;
if (p == null)
return;
if (p.Value != null && p.Value.Type != JTokenType.Null)
Value = p.Value;
}
internal override void ClearItems()
{
throw new JsonException("Cannot add or remove items from {0}.".FormatWith(CultureInfo.InvariantCulture, typeof(JProperty)));