To make my need easier to explain I will use a case that everybody knows.
Remember when you are registering a new Hotmail account, when entering the new Microsoft Account and you leave the field, this value is validated against the database to check if it's available.
How do I do that using just DataAnnotations and Validation Methods on the DomainService metadata?
I'm using an ADO NET Entity Model autogenerated from a SQL Express Database, RIA Services, Data Annotations, Validation Methods, and Silverlight 5.
I just checked Jeff Handley's blog on the subject, and he introduces a solution that involves creating a service that makes the Data available from the validation method on the server. The problem is that this solution doesn't work well on my case, he uses a two tables entity model, and makes some tricks that only work with that simple case and not on mine.
Have somebody worked out this problem succesfully?
I could create a stored procedure and invoke it just before submitting changes in the silverlight app or I could make the extra validation in the OnSave method of my ViewModel, but it means that I'm completing the validation process from the client, and I'd like to do it entirely from the server to avoid repeating code.
Besides, I would like to make the validation before pressing "Save".
Rafael
This is how its done: Creating custom data annotation validation in MVC 3.
Briefly they check user name availability against the database during registration
Edit
I think here is better link (not Q-A, but actual article on How-To):
How to: Implement Remote Validation in ASP.NET MVC
Hope this helps.