public CompareStruct CompareStruct(JObject originalObject, JObject newObject) { CompareStruct resultStruct = new CompareStruct(); foreach (var childNode in originalObject.Children()) { var property = childNode as JProperty; string name = property.Name; var value = property.Value; resultStruct.Fields.Add(name, Compare(value, newObject[name])); } return(resultStruct); }
public CompareStruct CompareStruct(JObject originalObject, JObject newObject) { CompareStruct resultStruct = new CompareStruct(); if (originalObject == null && newObject == null) { throw new Exception("Not supported type"); } if (originalObject == null) { foreach (var childNode in newObject.Children()) { var property = childNode as JProperty; string name = property.Name; var value = property.Value; resultStruct.Fields.Add(name, Compare(null, newObject[name])); } } else if (newObject == null) { foreach (var childNode in originalObject.Children()) { var property = childNode as JProperty; string name = property.Name; var value = property.Value; resultStruct.Fields.Add(name, Compare(value, null)); } } else { foreach (var childNode in originalObject.Children()) { var property = childNode as JProperty; string name = property.Name; var value = property.Value; resultStruct.Fields.Add(name, Compare(value, newObject[name])); } } return(resultStruct); }
public CompareStruct CompareStruct(JObject originalObject, JObject newObject) { CompareStruct resultStruct = new CompareStruct(); foreach (var childNode in originalObject.Children()) { var property = childNode as JProperty; string name = property.Name; var value = property.Value; resultStruct.Fields.Add(name, Compare(value, newObject[name])); } return resultStruct; }