ArgumentOutOfRangeException.ThrowIfEqual<T>(T, T, String) Metoda

Definice

Vyvolá hodnotu ArgumentOutOfRangeException if value je rovna other.

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

Parametry typu

T

Typ objektů, které chcete ověřit.

Parametry

value
T

Argument, který se má ověřit jako nerovnající se other.

other
T

Hodnota, která se má porovnat s value.

paramName
String

Název parametru, který value odpovídá.

Platí pro