Specifies that null
is allowed as an input even if the corresponding type disallows it.
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
To override a method that has a parameter annotated with this attribute, use the ?
operator. For example: override ISet<Enum> ReadJson(JsonReader reader, Type objectType, ISet<Enum>? existingValue, bool hasExistingValue, JsonSerializer serializer)
. For more information, see Nullable static analysis in the C# guide.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4