• Api Documentation
Show / Hide Table of Contents
  • Ubiquity.NET.ArgValidators
    • ValidatedNotNullAttribute
    • Validators
      • ValidateDefined
      • ValidateLength
      • ValidateNotDefault
      • ValidateNotNull
      • ValidateNotNullOrWhiteSpace
      • ValidatePattern
      • ValidateRange

Method ValidateRange

 

ValidateRange<T>(T, T, T, String)

Verifies a parameter is within a valid range.

Declaration
public static void ValidateRange<T>(this T i, T min, T max, string paramName)
    where T : struct, IComparable<T>

Parameters

T i

Value of the parameter to test.

T min

Minimum allowed value.

T max

Maximum allowed value.

System.String paramName

Name of the parameter for the exception if the i is outside the specified range.

Type Parameters

T

Type of the parameter (must be a value type supporting comparisons).

Back to top Copyright (C) 2017-2021, Ubiquity.NET Contributors
Build: 7.0.0