I’ve gotten quite a few requests for the source code behind the RIA Services Validation blog post series.  I am pleased to announce that the code is now published on GitHub.


Within that repository, you’ll find:

  1. RudeValidation.Web/Models – Server-side model classes
  2. RudeValidation.Web/Validators – Custom validators including CompareValidator, ConditionallyRequired, and DateValidator
  3. RudeValidation/Views – Sample screens showing the validation in action
  4. RudeValidation/ViewModels - Where you’ll find the sample ViewModel as well as the very simple ViewModelBase

If you’re not familiar with Git, don’t be intimidated.  You can easily view the code directly in your browser by starting out at http://github.com/jeffhandley/RIAServicesValidation and just clicking through the folders and files.  To download all of the source, just click the Downloads button, and click to download the Zip file.  As always when downloading a Zip from the tubes, be sure to Unblock the Zip file through the Properties window before you extract the contents.  Then, be sure to set the RudeValidation.Web project as the startup.  After that, you are welcome to do whatever you want with the source code included.

RIA Services Validation Recap

Over the course of a 10-post series, we learned about the standard validators, how to create different types of custom validators, how the validation attributes get propagated, how to perform common cross-field and cross-entity validation, and now we have a utility for importing model rules into ViewModel classes.  Here’s the full series:

    1. Standard Validators
    2. Custom Validation Methods
    3. Custom Reusable Validators
    4. Attribute Propagation
    5. Validation Triggers
    6. Cross-Field Validation
    7. Entity-Level Validation
    8. Providing ValidationContext
    9. Using ValidationContext (Cross-Entity Validation)
    10. ViewModel Validation with Entity Rules