This project is read-only.

Castle Runner for Buddy Classes

Dec 18, 2009 at 4:48 PM

First off, xVal is great.  In my implementation I need buddy classes since I'm extending classes already defined by entity framework.  The DataAnnotationsValidationRunner doesn't detect valid email addresses [DataType(DataType.EmailAddress)] (it was letting "blah" through as valid), so I decided to try out Castle Validator.  I set up a runner and followed the instructions here: 

It worked great if I removed the buddy classes.  However, when I set the validation rule within the buddy class, it doesn't get triggered.  Comparing the two runners makes it pretty clear on why (the code sample doesn't look at buddy attributes).  However, I don't understand how to modify it so that it will pick them up. Can someone help with a rewritten runner? 

Without the improved runner, my client side validation seems to be ok, but I want it working server-side too so that my unit tests will work. 

Thanks in advance.