public static bool IsEqual<T>(T x, T y)
{
PropertyInfo[] infos = typeof(T).GetProperties();
foreach (PropertyInfo info in infos ?? new PropertyInfo[0])
{
if (info.GetValue(x, new object[0]) == null || info.GetValue(y, new object[0]) == null)
{
return true;
}
else
{
if (info.Name.ToUpper() == "CREATEDON" || info.Name.ToUpper() == "MODIFIEDON") continue;
if (info.GetValue(x, new object[0]).GetHashCode() != info.GetValue(y, new object[0]).GetHashCode())
{
return false;
}
}
}
return true;
}
{
PropertyInfo[] infos = typeof(T).GetProperties();
foreach (PropertyInfo info in infos ?? new PropertyInfo[0])
{
if (info.GetValue(x, new object[0]) == null || info.GetValue(y, new object[0]) == null)
{
return true;
}
else
{
if (info.Name.ToUpper() == "CREATEDON" || info.Name.ToUpper() == "MODIFIEDON") continue;
if (info.GetValue(x, new object[0]).GetHashCode() != info.GetValue(y, new object[0]).GetHashCode())
{
return false;
}
}
}
return true;
}