private static bool IsNullOrDefault<T>(this PropertyInfo pi, T obj)
{
object defaultValue = pi.PropertyType.IsValueType
? Activator.CreateInstance(pi.PropertyType)
: null;
var actualValue = pi.GetValue(obj, default);
return Equals(defaultValue, actualValue);
}