Check for Null or Default on C# properties, whether they be reference type or classes

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);
}