O'Reilly logo

Microsoft Silverlight 5 Data and Services Cookbook by Kevin Dockx, Gill Cleeren

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required