I am uisng Silverlight 3 and ADO.NET Data Services with a cusotm-built Model (separate project) and DAL (separate project)) in place. Within my Silverlight project, I create a [Service Reference] that references my .svc file that in turn points to my Model.
Here's my question: I would like to use the rich features of DataAnnotations (System.ComponentModel.DataAnnotations) but where exactly do I put these attributes? If I decorate by Model with these annotations, I don't see them rendered in my [Service Reference]-generated proxy code. I just see my classes with its members, but no DataAnnotations (Reference.cs).
I know if I manually change the (Reference.cs) file and add some DataAnnotations, these changes to trickle throught to my Silverlight Client. I don't believe I should be updating generated code, i.e. proxy code w/in (Reference.cs). So, my question is, where in my Visual Studio structure of separated projects (Web, SL, Model, DAL), do I throw/extend this custom datasource (Model) to utilize DataAnnotations?
I would like something like this:
[Required]
public string FirstName
{
get
{
return this._FirstName;
}
set
{
this.OnFirstNameChanging(value);
this._FirstName = value;
this.OnFirstNameChanged();
}
}