예제 #1
0
 public static T Min <T>(T v1, T v2)
 {
     return(Operator.LessThanOrEqual(v1, v2) ? v1 : v2);
 }
예제 #2
0
 /// <summary>
 /// Evaluates binary less-than-or-equal (&lt;=) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static bool LessThanOrEqual <T>(T value1, T value2)
 {
     return(Operator <T> .LessThanOrEqual(value1, value2));
 }