Guard.IsBetween Method

Definition

Overloads

IsBetween(SByte, SByte, SByte, String)

Asserts that the input value must be in a given interval.

IsBetween(UIntPtr, UIntPtr, UIntPtr, String)

Asserts that the input value must be in a given interval.

IsBetween(UInt64, UInt64, UInt64, String)

Asserts that the input value must be in a given interval.

IsBetween(UInt32, UInt32, UInt32, String)

Asserts that the input value must be in a given interval.

IsBetween(UInt16, UInt16, UInt16, String)

Asserts that the input value must be in a given interval.

IsBetween(Single, Single, Single, String)

Asserts that the input value must be in a given interval.

IsBetween(IntPtr, IntPtr, IntPtr, String)

Asserts that the input value must be in a given interval.

IsBetween(Double, Double, Double, String)

Asserts that the input value must be in a given interval.

IsBetween(Int32, Int32, Int32, String)

Asserts that the input value must be in a given interval.

IsBetween(Int16, Int16, Int16, String)

Asserts that the input value must be in a given interval.

IsBetween(Int64, Int64, Int64, String)

Asserts that the input value must be in a given interval.

IsBetween(Decimal, Decimal, Decimal, String)

Asserts that the input value must be in a given interval.

IsBetween(Char, Char, Char, String)

Asserts that the input value must be in a given interval.

IsBetween(Byte, Byte, Byte, String)

Asserts that the input value must be in a given interval.

IsBetween<T>(T, T, T, String)

Asserts that the input value must be in a given interval.

IsBetween(SByte, SByte, SByte, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
SByte

The input SByte value to test.

minimum
SByte

The exclusive minimum SByte value that is accepted.

maximum
SByte

The exclusive maximum SByte value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(UIntPtr, UIntPtr, UIntPtr, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
UIntPtr

nuint

unativeint

The input nuint value to test.

minimum
UIntPtr

nuint

unativeint

The exclusive minimum nuint value that is accepted.

maximum
UIntPtr

nuint

unativeint

The exclusive maximum nuint value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(UInt64, UInt64, UInt64, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
UInt64

The input UInt64 value to test.

minimum
UInt64

The exclusive minimum UInt64 value that is accepted.

maximum
UInt64

The exclusive maximum UInt64 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(UInt32, UInt32, UInt32, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
UInt32

The input UInt32 value to test.

minimum
UInt32

The exclusive minimum UInt32 value that is accepted.

maximum
UInt32

The exclusive maximum UInt32 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(UInt16, UInt16, UInt16, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
UInt16

The input UInt16 value to test.

minimum
UInt16

The exclusive minimum UInt16 value that is accepted.

maximum
UInt16

The exclusive maximum UInt16 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(Single, Single, Single, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
Single

The input Single value to test.

minimum
Single

The exclusive minimum Single value that is accepted.

maximum
Single

The exclusive maximum Single value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(IntPtr, IntPtr, IntPtr, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
IntPtr

nint

nativeint

The input nint value to test.

minimum
IntPtr

nint

nativeint

The exclusive minimum nint value that is accepted.

maximum
IntPtr

nint

nativeint

The exclusive maximum nint value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(Double, Double, Double, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
Double

The input Double value to test.

minimum
Double

The exclusive minimum Double value that is accepted.

maximum
Double

The exclusive maximum Double value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(Int32, Int32, Int32, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
Int32

The input Int32 value to test.

minimum
Int32

The exclusive minimum Int32 value that is accepted.

maximum
Int32

The exclusive maximum Int32 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(Int16, Int16, Int16, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
Int16

The input Int16 value to test.

minimum
Int16

The exclusive minimum Int16 value that is accepted.

maximum
Int16

The exclusive maximum Int16 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(Int64, Int64, Int64, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
Int64

The input Int64 value to test.

minimum
Int64

The exclusive minimum Int64 value that is accepted.

maximum
Int64

The exclusive maximum Int64 value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(Decimal, Decimal, Decimal, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
Decimal

The input Decimal value to test.

minimum
Decimal

The exclusive minimum Decimal value that is accepted.

maximum
Decimal

The exclusive maximum Decimal value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(Char, Char, Char, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
Char

The input Char value to test.

minimum
Char

The exclusive minimum Char value that is accepted.

maximum
Char

The exclusive maximum Char value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween(Byte, Byte, Byte, String)

Asserts that the input value must be in a given interval.

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

Parameters

value
Byte

The input Byte value to test.

minimum
Byte

The exclusive minimum Byte value that is accepted.

maximum
Byte

The exclusive maximum Byte value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsBetween<T>(T, T, T, String)

Asserts that the input value must be in a given interval.

public static void IsBetween<T> (T value, T minimum, T maximum, string name) where T : IComparable<T>;
static member IsBetween : 'T * 'T * 'T * string -> unit (requires 'T :> IComparable<'T>)
Public Shared Sub IsBetween(Of T As IComparable(Of T)) (value As T, minimum 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.

minimum
T

The exclusive minimum T value that is accepted.

maximum
T

The exclusive maximum T value that is accepted.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is <= minimum or >= maximum.

Remarks

This API asserts the equivalent of "value in (minimum, maximum)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.

Applies to