0
votes

I'm starting up with Entity Framework and RIA Services. I'm also evaluating whether to use POCO or not, I believe it is the way to go since we will work on an agile (scrum) environment... (so far)

With the self-tracked entities I could add decorators on the metadata in order to get client-side validation. How can I achieve the same with POCO classes? I wouldn't want to modify generated files, cause they will be genrated tons of times biefore the final release and (of course) I don't want to write my validation code every time.

1

1 Answers

1
votes

Can't you continue to do it with partial classes and metadata types? Something like this.

[MetadataType(typeof(MyEntity.Metadata))]
public partial class MyEntity
{
  private class Metadata
  {
    [Required]
    [StringLength(5)]
    public string MyProperty;
  }
}