Validation of your data is a requirement for almost every application. By using validation, you make sure that no invalid data is (eventually) persisted in your datastore. When you don't implement validation, there's a risk that a user will input wrongly formatted or plain incorrect data on the screen and even persist this data in your datastore. This is something you should definitely avoid.
In this recipe, we'll learn about implementing client-side validation on the bound fields in the UI using attributes (Data Annotations).
To get ready for this recipe, you can either use the code from the previous recipe or use the provided starter solution in the