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

Definizione

Genera un'eccezione ArgumentOutOfRangeException se value è uguale a 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)

Parametri di tipo

T

Tipo degli oggetti da convalidare.

Parametri

value
T

Argomento da convalidare come diverso da other.

other
T

Valore da confrontare con value.

paramName
String

Nome del parametro con cui value corrisponde.

Si applica a