Beispiel #1
0
 /// <summary>
 /// Check the value is within specified range (inclusive of bounds).
 /// </summary>
 /// <param name="value">The value to check.</param>
 /// <param name="lowerBound">The range lower bound (inclusive).</param>
 /// <param name="upperBound">The range upper bound (inclusive).</param>
 /// <param name="paramName">The parameter name.</param>
 /// <exception cref="ArgumentOutOfRangeException">If the value is out of the specified range.</exception>
 public static void NotOutOfRangeDecimal(
     decimal value,
     decimal lowerBound,
     decimal upperBound,
     string paramName)
 {
     if (value < lowerBound || value > upperBound)
     {
         throw new ArgumentOutOfRangeException(paramName, FailedMsg.WasOutOfRange(value, lowerBound, upperBound, paramName));
     }
 }
Beispiel #2
0
 /// <summary>
 /// Check the value is within specified range (inclusive of bounds).
 /// </summary>
 /// <param name="value">The value to check.</param>
 /// <param name="lowerBound">The range lower bound (inclusive).</param>
 /// <param name="upperBound">The range upper bound (inclusive).</param>
 /// <param name="paramName">The parameter name.</param>
 /// <exception cref="ArgumentOutOfRangeException">If the value is out of the specified range.</exception>
 public static void NotOutOfRangeInt64(
     long value,
     long lowerBound,
     long upperBound,
     string paramName)
 {
     if (value < lowerBound || value > upperBound)
     {
         throw new ArgumentOutOfRangeException(paramName, FailedMsg.WasOutOfRange(value, lowerBound, upperBound, paramName));
     }
 }