AllowNullAttribute Classe

Definizione

Specifica che null è consentito come input anche se il tipo corrispondente non lo consente.

public ref class AllowNullAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property, Inherited=false)]
public sealed class AllowNullAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property, Inherited=false)>]
type AllowNullAttribute = class
    inherit Attribute
Public NotInheritable Class AllowNullAttribute
Inherits Attribute
Ereditarietà
AllowNullAttribute
Attributi

Commenti

Per eseguire l'override di un metodo con un parametro annotato con questo attributo, usare l'operatore ? . Ad esempio: override ISet<Enum> ReadJson(JsonReader reader, Type objectType, ISet<Enum>? existingValue, bool hasExistingValue, JsonSerializer serializer). Per altre informazioni, vedere Analisi statica nullable nella guida di C#.

Costruttori

Nome Descrizione
AllowNullAttribute()

Inizializza una nuova istanza della classe AllowNullAttribute.

Proprietà

Nome Descrizione
TypeId

Se implementato in una classe derivata, ottiene un identificatore univoco per questo Attribute.

(Ereditato da Attribute)

Metodi

Nome Descrizione
Equals(Object)

Restituisce un valore che indica se questa istanza è uguale a un oggetto specificato.

(Ereditato da Attribute)
GetHashCode()

Restituisce il codice hash per questa istanza.

(Ereditato da Attribute)
GetType()

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
IsDefaultAttribute()

Quando sottoposto a override in una classe derivata, indica se il valore di questa istanza è il valore predefinito per la classe derivata.

(Ereditato da Attribute)
Match(Object)

Quando sottoposto a override in una classe derivata, restituisce un valore che indica se questa istanza è uguale a un oggetto specificato.

(Ereditato da Attribute)
MemberwiseClone()

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Si applica a

Vedi anche