Skip to main content

Comparer

Custom logic for performing comparisons

Assembly: ServiceStack.dll
View Source
Declaration
public static class Comparer

Methods

TryCompare(IComparable, IComparable, out Int32)

Tries to compare the two objects.

View Source
Declaration
public static bool TryCompare(IComparable value, IComparable valueToCompare, out int result)
Returns

System.Boolean: True if all went well, otherwise False.

Parameters
TypeNameDescription
System.IComparablevalue

| | System.IComparable | valueToCompare |

| | System.Int32 | result | The resulting comparison value.

|

GetComparisonResult(IComparable, IComparable)

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

View Source
Declaration
public static int GetComparisonResult(IComparable value, IComparable valueToCompare)
Returns

System.Int32: True on success, otherwise False.

Parameters
TypeName
System.IComparablevalue
System.IComparablevalueToCompare

GetEqualsResult(IComparable, IComparable)

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

View Source
Declaration
public static bool GetEqualsResult(IComparable value, IComparable valueToCompare)
Returns

System.Boolean: True on success, otherwise False.

Parameters
TypeName
System.IComparablevalue
System.IComparablevalueToCompare