More explicit analogy

- "... to validation of fields in **database** tables."
pull/1223/merge
Lars Gyrup Brink Nielsen 2016-05-15 22:15:13 +02:00 committed by danroth27
parent 1429225157
commit 370208aa41
1 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ Fortunately, .NET has abstracted validation into validation attributes. These at
Validation Attributes Validation Attributes
--------------------- ---------------------
Validation attributes are a way to configure model validation so it's similar conceptually to validation on fields in tables. This includes constraints such as assigning data types or required fields. Other types of validation include applying patterns to data to enforce business rules, such as a credit card, phone number, or email address. Validation attributes make enforcing these requirements much simpler and easier to use. Validation attributes are a way to configure model validation so it's similar conceptually to validation on fields in database tables. This includes constraints such as assigning data types or required fields. Other types of validation include applying patterns to data to enforce business rules, such as a credit card, phone number, or email address. Validation attributes make enforcing these requirements much simpler and easier to use.
Below is an annotated ``Movie`` model from an app that stores information about movies and TV shows. Most of the properties are required and several string properties have length requirements. Additionally, there is a numeric range restriction in place for the ``Price`` property from 0 to $999.99, along with a custom validation attribute. Below is an annotated ``Movie`` model from an app that stores information about movies and TV shows. Most of the properties are required and several string properties have length requirements. Additionally, there is a numeric range restriction in place for the ``Price`` property from 0 to $999.99, along with a custom validation attribute.