From 370208aa417be6dc3f350770a38b2606863b6558 Mon Sep 17 00:00:00 2001 From: Lars Gyrup Brink Nielsen Date: Sun, 15 May 2016 22:15:13 +0200 Subject: [PATCH] More explicit analogy - "... to validation of fields in **database** tables." --- aspnet/mvc/models/validation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnet/mvc/models/validation.rst b/aspnet/mvc/models/validation.rst index 7ae11c373b..0509f042f3 100644 --- a/aspnet/mvc/models/validation.rst +++ b/aspnet/mvc/models/validation.rst @@ -18,7 +18,7 @@ Fortunately, .NET has abstracted validation into validation attributes. These at 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. @@ -202,4 +202,4 @@ The second step is putting the validation code in the corresponding action metho :language: c# :lines: 6-23 -Now when users enter an email, JavaScript in the view makes a remote call to see if that email has been taken, and if so, then displays the error message. Otherwise, the user can submit the form as usual. \ No newline at end of file +Now when users enter an email, JavaScript in the view makes a remote call to see if that email has been taken, and if so, then displays the error message. Otherwise, the user can submit the form as usual.