public bool AllowNull { get; }
Public ReadOnly Property AllowNull As Boolean
Get
Dim instance As CommandLineArgument
Dim value As Boolean
value = instance.AllowNull
public:
property bool AllowNull {
bool get ();
}
For a multi-value argument, this value indicates whether the element type can be .
For a dictionary argument, this value indicates whether the type of the dictionary's values can be . Dictionary key types are always non-nullable, as this is a constraint on DictionaryTKey, TValue. This works only if the argument type is DictionaryTKey, TValue or IDictionaryTKey, TValue, or if source generation was used. For other types that implement IDictionaryTKey, TValue, it is not possible to determine the nullability of TValue at runtime except if it's a value type.
This property indicates what happens when the ArgumentConverterConvert(String, CultureInfo, CommandLineArgument) method used for this argument returns .
If this property is , the argument's value will be set to . If it's , a CommandLineArgumentException will be thrown during parsing with CommandLineArgumentErrorCategoryNullArgumentValue.
If the project containing the command line argument type does not use nullable reference types, or does not support them (e.g. on older .Net versions), this property will only be for value types other than NullableT. Only on .Net 6.0 and later, or if source generation was used with the GeneratedParserAttribute, attribute will the property be for non-nullable reference types. Although nullable reference types are available on .Net Core 3.x, only .Net 6.0 and later will get this behavior without source generation due to the necessary runtime support to determine nullability of a property or method parameter.