Guard.IsLessThanOrEqualTo Method

Definition

Overloads

IsLessThanOrEqualTo(UInt32, UInt32, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(UInt16, UInt16, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(Single, Single, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(SByte, SByte, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(IntPtr, IntPtr, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(Int64, Int64, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(Decimal, Decimal, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(Int16, Int16, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(Double, Double, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(UInt64, UInt64, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(Char, Char, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(Byte, Byte, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(Int32, Int32, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(UIntPtr, UIntPtr, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo<T>(T, T, String)

Asserts that the input value must be less than or equal to a specified value.

IsLessThanOrEqualTo(UInt32, UInt32, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (uint value, uint maximum, string name);
static member IsLessThanOrEqualTo : uint32 * uint32 * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As UInteger, maximum As UInteger, name As String)

Parameters

value
UInt32

The input UInt32 value to test.

maximum
UInt32

The inclusive maximum UInt32 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(UInt16, UInt16, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (ushort value, ushort maximum, string name);
static member IsLessThanOrEqualTo : uint16 * uint16 * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As UShort, maximum As UShort, name As String)

Parameters

value
UInt16

The input UInt16 value to test.

maximum
UInt16

The inclusive maximum UInt16 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(Single, Single, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (float value, float maximum, string name);
static member IsLessThanOrEqualTo : single * single * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As Single, maximum As Single, name As String)

Parameters

value
Single

The input Single value to test.

maximum
Single

The inclusive maximum Single value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(SByte, SByte, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (sbyte value, sbyte maximum, string name);
static member IsLessThanOrEqualTo : sbyte * sbyte * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As SByte, maximum As SByte, name As String)

Parameters

value
SByte

The input SByte value to test.

maximum
SByte

The inclusive maximum SByte value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(IntPtr, IntPtr, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (nint value, nint maximum, string name);
static member IsLessThanOrEqualTo : nativeint * nativeint * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As IntPtr, maximum As IntPtr, name As String)

Parameters

value
IntPtr

nint

nativeint

The input nint value to test.

maximum
IntPtr

nint

nativeint

The inclusive maximum nint value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(Int64, Int64, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (long value, long maximum, string name);
static member IsLessThanOrEqualTo : int64 * int64 * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As Long, maximum As Long, name As String)

Parameters

value
Int64

The input Int64 value to test.

maximum
Int64

The inclusive maximum Int64 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(Decimal, Decimal, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (decimal value, decimal maximum, string name);
static member IsLessThanOrEqualTo : decimal * decimal * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As Decimal, maximum As Decimal, name As String)

Parameters

value
Decimal

The input Decimal value to test.

maximum
Decimal

The inclusive maximum Decimal value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(Int16, Int16, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (short value, short maximum, string name);
static member IsLessThanOrEqualTo : int16 * int16 * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As Short, maximum As Short, name As String)

Parameters

value
Int16

The input Int16 value to test.

maximum
Int16

The inclusive maximum Int16 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(Double, Double, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (double value, double maximum, string name);
static member IsLessThanOrEqualTo : double * double * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As Double, maximum As Double, name As String)

Parameters

value
Double

The input Double value to test.

maximum
Double

The inclusive maximum Double value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(UInt64, UInt64, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (ulong value, ulong maximum, string name);
static member IsLessThanOrEqualTo : uint64 * uint64 * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As ULong, maximum As ULong, name As String)

Parameters

value
UInt64

The input UInt64 value to test.

maximum
UInt64

The inclusive maximum UInt64 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(Char, Char, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (char value, char maximum, string name);
static member IsLessThanOrEqualTo : char * char * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As Char, maximum As Char, name As String)

Parameters

value
Char

The input Char value to test.

maximum
Char

The inclusive maximum Char value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(Byte, Byte, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (byte value, byte maximum, string name);
static member IsLessThanOrEqualTo : byte * byte * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As Byte, maximum As Byte, name As String)

Parameters

value
Byte

The input Byte value to test.

maximum
Byte

The inclusive maximum Byte value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(Int32, Int32, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (int value, int maximum, string name);
static member IsLessThanOrEqualTo : int * int * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As Integer, maximum As Integer, name As String)

Parameters

value
Int32

The input Int32 value to test.

maximum
Int32

The inclusive maximum Int32 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo(UIntPtr, UIntPtr, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo (nuint value, nuint maximum, string name);
static member IsLessThanOrEqualTo : unativeint * unativeint * string -> unit
Public Shared Sub IsLessThanOrEqualTo (value As UIntPtr, maximum As UIntPtr, name As String)

Parameters

value
UIntPtr

nuint

unativeint

The input nuint value to test.

maximum
UIntPtr

nuint

unativeint

The inclusive maximum nuint value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsLessThanOrEqualTo<T>(T, T, String)

Asserts that the input value must be less than or equal to a specified value.

public static void IsLessThanOrEqualTo<T> (T value, T maximum, string name) where T : IComparable<T>;
static member IsLessThanOrEqualTo : 'T * 'T * string -> unit (requires 'T :> IComparable<'T>)
Public Shared Sub IsLessThanOrEqualTo(Of T As IComparable(Of T)) (value As T, maximum As T, name As String)

Type Parameters

T

The type of input values to compare.

Parameters

value
T

The input T value to test.

maximum
T

The inclusive maximum T value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is > maximum.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to