using System.Collections.Generic;
public static void Main()
Dictionary<string, object> d1 = new Dictionary<string, object> {
Dictionary<string, object> d2 = new Dictionary<string, object> {
GetDifferent(d1, d2).ForEach(d => {
private static List<string> GetDifferent(Dictionary<string, object> currentValues, Dictionary<string, object> previousValues)
var changed = currentValues
.Where(k => previousValues.Any(p => p.Key == k.Key && !AreValueEquals(k.Value, p.Value)))
private static object GetIfExists(Dictionary<string, object> values, string fieldName)
return values.ContainsKey(fieldName) ? values[fieldName] : null;
private static bool AreValueEquals(object o1, object o2)
return (o1 != null && o1.GetType().IsValueType)