BindRequiredAttribute Class¶
Indicates that a property is required for model binding. When applied to a property, the model binding system requires a value for that property. When applied to a type, the model binding system requires values for all properties of that type.
- Namespace
Microsoft.AspNetCore.Mvc.ModelBinding- Assemblies
- Microsoft.AspNetCore.Mvc.Core
Inheritance Hierarchy¶
System.ObjectSystem.AttributeMicrosoft.AspNetCore.Mvc.ModelBinding.BindingBehaviorAttributeMicrosoft.AspNetCore.Mvc.ModelBinding.BindRequiredAttribute
Syntax¶
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class BindRequiredAttribute : BindingBehaviorAttribute, _Attribute
-
class
Microsoft.AspNetCore.Mvc.ModelBinding.BindRequiredAttribute
Constructors¶
-
BindRequiredAttribute()¶ Initializes a new
Microsoft.AspNetCore.Mvc.ModelBinding.BindRequiredAttributeinstance.public BindRequiredAttribute()
-