开发者

RIA Services and EF validation

开发者 https://www.devze.com 2023-02-09 05:32 出处:网络
I\'m developing a Silverlight application with Entity Framework and RIA Services. When I create the RIA Service I have the option to generate a metadata class for basic validation.

I'm developing a Silverlight application with Entity Framework and RIA Services. When I create the RIA Service I have the option to generate a metadata class for basic validation.

What is the difference between the validation I can do directly with EF and the one in the metadata class generated with RIA service? I mean, if I have a property in the EF model which is not null, I don't need to mark it in the metadata c开发者_Python百科lass as [Required]... Is it because this is already done by the EF model??

THANKS!


With the metadata classes you can add more validation logic to your entities. See the namespace System.ComponentModel.DataAnnotations for more details. EF currently only supportes the Required attribute. The namespace provides more attributes, such as RangeAttribute, StringLength or custom attributes that you define for your own validation logic.

Jeff Handly has a good series of blog post, that describe the validation process and elements in WCF Ria Services.

0

精彩评论

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