LessThan

public static bool LessThan<T>(this IComparable<T> comparable, T other)
{
  return comparable.CompareTo(other) < 0;
}
Example:
var t1 = new Temperature(273);
var t2 = new Temperature(100);

if (t1.LessThan(t2))
  Console.WriteLine("t1 is less than t2");

Description

Returns a boolean value of true if the item being compared is less than the value of the parameter.

Details

Double click on the code to select all.

 

;