public bool IsDefaultValueOn(T instance) { var value = _getter(instance); return(value == null || IsStringDefaultValue(value) || _comparerForDefaultValueComparison.Equals(value, default(TProperty))); }
public bool AreEqual(T source, T destination, out Conflict conflict) { var sourceProperty = _getter(source); var destinationProperty = _getter(destination); var areEqual = _softComparer.Equals(sourceProperty, destinationProperty); if (!areEqual) { conflict = new Conflict(Name, sourceProperty.ToString(), destinationProperty.ToString()); } else { conflict = null; } return(areEqual); }
public int Evaluate(T x, T y) { return(_comparer.Equals(_propertyAccessor(x), _propertyAccessor(y)) ? _weight : 0); }