New
Hi, in the latest (unstable) check in, usage of the new Internal.Comparer fails in these validators if they've been used for object type properties that don't implement IComparable. Suggest the Compare method of each is changed to fall back to default equality comparison when this occurs:
```
protected bool Compare(object comparisonValue, object propertyValue)
{
if (comparer != null)
{
return comparer.Equals(comparisonValue, propertyValue);
}
if (comparisonValue is IComparable && propertyValue is IComparable)
{
return Internal.Comparer.GetEqualsResult((IComparable)comparisonValue, (IComparable)propertyValue);
}
return comparisonValue == propertyValue;
}
```
Or you could use Object.ReferenceEquals and/or use reflection(?) to find the generic EqualityComparer<T>.Default for the property being examined.
Hi, in the latest (unstable) check in, usage of the new Internal.Comparer fails in these validators if they've been used for object type properties that don't implement IComparable. Suggest the Compare method of each is changed to fall back to default equality comparison when this occurs:
```
protected bool Compare(object comparisonValue, object propertyValue)
{
if (comparer != null)
{
return comparer.Equals(comparisonValue, propertyValue);
}
if (comparisonValue is IComparable && propertyValue is IComparable)
{
return Internal.Comparer.GetEqualsResult((IComparable)comparisonValue, (IComparable)propertyValue);
}
return comparisonValue == propertyValue;
}
```
Or you could use Object.ReferenceEquals and/or use reflection(?) to find the generic EqualityComparer<T>.Default for the property being examined.