When controlling the binding behavior of models in ASP.NET Core MVC applications, it is very common to perform some validation on them. For that, data annotations are a perfect tool.
One of the most typical use cases of data annotations is to ensure that a value of a certain property has been provided by the caller of the API – and this, historically (in “classic” ASP.NET MVC), has been controlled by RequiredAttribute. The attribute can still be used in ASP.NET Core MVC, but there is also a new one – BindRequiredAttribute.
Let’s have a look at the subtle differences between them.