using System.Collections.Generic;
public static void Main()
Console.WriteLine(poco.HasChanged("Prop1"));
Console.WriteLine(poco.HasChanged("Prop2"));
public class POCO : HasChangedBase
public string Prop1 {get;set;}
public string Prop2 {get;set;}
public class HasChangedBase
private class PropertyState
public PropertyInfo Property {get;set;}
public Object Value {get;set;}
private Dictionary<string, PropertyState> propertyStore;
.ToDictionary(p=>p.Name, p=>new PropertyState{Property = p, Value = p.GetValue(this)});
public bool HasChanged(string propertyName)
return propertyStore != null
&& propertyStore.ContainsKey(propertyName)
&& propertyStore[propertyName].Value != propertyStore[propertyName].Property.GetValue(this);