使用Linq到实体的验证 [英] Validations using Linq to Entities

查看:58
本文介绍了使用Linq到实体的验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们在WCF服务中使用Linq to Entities。我们创建了一个包含自动生成实体的edmx文件。我们需要验证实体类中的字段。所以我们所做的是为每个实体创建一个单独的部分类,并在OnChanging事件及其工作中进行验证。有没有其他更好的方法在自动生成的实体中进行验证?

问候
赛车

Hi,

We are using Linq to Entities in WCF service. We created a edmx file which contains auto generated entities. we need to validate the fields in the entity classes. So what we did is we created a separate partial class for each entities and doing the validation in the OnChanging event and its working. Is there any other better way to do validation in the autogenerated entities?

Regards
Syed

推荐答案

你可以使用
you could use the 


这篇关于使用Linq到实体的验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆