开发者

How to get client validation with RIA services working with POCO?

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 bie开发者_如何学运维fore the final release and (of course) I don't want to write my validation code every time.


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;
  }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜