C# Class FluentValidation.Internal.Comparer

Custom logic for performing comparisons
Mostrar archivo Open project: JeremySkinner/FluentValidation

Public Methods

Method Description
GetComparisonResult ( IComparable value, IComparable valueToCompare ) : int

Tries to compare the two objects, but will throw an exception if it fails.

GetEqualsResult ( IComparable value, IComparable valueToCompare ) : bool

Tries to compare the two objects, but will throw an exception if it fails.

TryCompare ( IComparable value, IComparable valueToCompare, int &result ) : bool

Tries to compare the two objects.

Private Methods

Method Description
Compare ( IComparable value, IComparable valueToCompare, int &result ) : void

Tries to do a proper comparison but may fail. First it tries the default comparison, if this fails, it will see if the values are fractions. If they are, then it does a double comparison, otherwise it does a long comparison.

Method Details

GetComparisonResult() public static method

Tries to compare the two objects, but will throw an exception if it fails.
public static GetComparisonResult ( IComparable value, IComparable valueToCompare ) : int
value IComparable
valueToCompare IComparable
return int

GetEqualsResult() public static method

Tries to compare the two objects, but will throw an exception if it fails.
public static GetEqualsResult ( IComparable value, IComparable valueToCompare ) : bool
value IComparable
valueToCompare IComparable
return bool

TryCompare() public static method

Tries to compare the two objects.
public static TryCompare ( IComparable value, IComparable valueToCompare, int &result ) : bool
value IComparable
valueToCompare IComparable
result int The resulting comparison value.
return bool