I wasn’t very happy when i saw the default way RIA services handles validation. It’s either having attributes directly on your classes or it’s those clumsy metadata inner classes which have the same property names as the parent ones. I like the fluent approach, and that approach is explained here:
RIA Services Fluent Metadata API
I even used it and modified it in my example which i presented in the following codeproject:
Setting up Silverlight, RIA Services, NHibernate and Validators
It’s a good example of the same thing.
Anyway, i did some modifications to that code and i didn’t know how to test the thing, if it was working ok or not. It ended up being super simple, but i had to go through a lot of Reflector stuff to get to the core. The basic debugging would look like this:
[TestMethod] public void TestMethod1() { var description = DomainServiceDescription.GetDescription(typeof(AltiFinService)); }
This is going to step you through your chained DescriptionProvider and you can see what’s actually happening while code generating. I did have 1 problem though which this kind of approach didn’t help much, but it was more or less assembly version issue.
HTH!
Leave a Comment