Lire en anglais

Partager via


ArgumentOutOfRangeException.ThrowIfNegative<T>(T, String) Méthode

Définition

Important

Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.

Lève un ArgumentOutOfRangeException si value est négatif.

C#
public static void ThrowIfNegative<T>(T value, string? paramName = default) where T : System.Numerics.INumberBase<T>;

Paramètres de type

T

Type de l'objet à valider.

Paramètres

value
T

Argument à valider comme non négatif.

paramName
String

Nom du paramètre avec lequel value correspond.

S’applique à

Produit Versions
.NET 8, 9, 10