Partager via


ModelMetadata.ConvertEmptyStringToNull Property

Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null.

Namespace:  System.Web.Http.Metadata
Assembly:  System.Web.Http (in System.Web.Http.dll)

Syntax

'Declaration
Public Overridable Property ConvertEmptyStringToNull As Boolean
    Get
    Set
'Usage
Dim instance As ModelMetadata
Dim value As Boolean

value = instance.ConvertEmptyStringToNull

instance.ConvertEmptyStringToNull = value
public virtual bool ConvertEmptyStringToNull { get; set; }
public:
virtual property bool ConvertEmptyStringToNull {
    bool get ();
    void set (bool value);
}
abstract ConvertEmptyStringToNull : bool with get, set
override ConvertEmptyStringToNull : bool with get, set
function get ConvertEmptyStringToNull () : boolean
function set ConvertEmptyStringToNull (value : boolean)

Property Value

Type: System.Boolean
true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true.

See Also

Reference

ModelMetadata Class

System.Web.Http.Metadata Namespace