BindingBehavior Enum

Enumerates behavior options of the model binding system.

Namespace
Microsoft.AspNetCore.Mvc.ModelBinding
Assemblies
  • Microsoft.AspNetCore.Mvc.Core

Syntax

public enum BindingBehavior
enum Microsoft.AspNetCore.Mvc.ModelBinding.BindingBehavior

Fields

Never()

The property should be excluded from model binding.

Return type:Microsoft.AspNetCore.Mvc.ModelBinding.BindingBehavior
Never = 1
Optional()

The property should be model bound if a value is available from the value provider.

Return type:Microsoft.AspNetCore.Mvc.ModelBinding.BindingBehavior
Optional = 0
Required()

The property is required for model binding.

Return type:Microsoft.AspNetCore.Mvc.ModelBinding.BindingBehavior
Required = 2