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

12. Advanced WCF RIA Services > Validating data: writing a custom validator

Validating data: writing a custom validator

Applies to Silverlight 4, 5

Validation of your data before persisting it is a requirement for almost every application. By using validation on your Entities, you make sure that no invalid data is persisted to your data store. With WCF RIA Services, there are various ways to do validation, each tailored to a specific scenario.

In this recipe, you'll learn how to validate data with custom validators: on a single property, cross-field and on the Entity level. We'll also look into a way to reuse these validators by implementing them as attributes.

Getting ready

Before getting started, you've got to make sure the correct SDK and assemblies to enable WCF RIA Services are available. Please refer to the recipe Setting up a data solution to work with WCF RIA Services from Chapter 11, Using WCF RIA Services, for more information.


  

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