Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
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.
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.