Share via


MvcOptions.AllowEmptyInputInBodyModelBinding Property

Definition

Gets or sets the flag which decides whether body model binding (for example, on an action method parameter with FromBodyAttribute) should treat empty input as valid. false by default.

public:
 property bool AllowEmptyInputInBodyModelBinding { bool get(); void set(bool value); };
public bool AllowEmptyInputInBodyModelBinding { get; set; }
member this.AllowEmptyInputInBodyModelBinding : bool with get, set
Public Property AllowEmptyInputInBodyModelBinding As Boolean

Property Value

Examples

When false, actions that model bind the request body (for example, using FromBodyAttribute) will register an error in the ModelStateDictionary if the incoming request body is empty.

Applies to