Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

6. Validating with the Validation API > Understanding How EF Combines Validatio...

Understanding How EF Combines Validations

Remember the DescriptionRules method that we added to the BusinessValidations class to validate the Description property of Destination and Trip? Those contain overall rules for writing any description for the company, not just those for destinations.

Now we’ll modify the Description in the ValidateTrip method to include the dreaded smiley face emoticon and exclamation point:

Description="Hope you won't be freezing on this trip! :)"

Before running the ValidateTrip method again, keep in mind that the values of this Trip instance break four rules:

  1. The StartDate is not at least a full calendar day before the EndDate.

  2. The word freezing is in the description.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint