共用方式為


ArgumentOutOfRangeException.ThrowIfGreaterThan<T>(T, T, String) 方法

定義

如果 value 大於 other ,則會擲回 ArgumentOutOfRangeException

public static void ThrowIfGreaterThan<T> (T value, T other, string? paramName = default) where T : IComparable<T>;
static member ThrowIfGreaterThan : 'T * 'T * string -> unit (requires 'T :> IComparable<'T>)
Public Shared Sub ThrowIfGreaterThan(Of T As IComparable(Of T)) (value As T, other As T, Optional paramName As String = Nothing)

類型參數

T

要驗證的物件類型。

參數

value
T

要驗證為小於或等於 other 的引數。

other
T

要與 value 比較的值。

paramName
String

對應之 value 參數的名稱。

適用於