使用实体框架实体业​​务对象? [英] Using Entity Framework entities as business objects?

查看:170
本文介绍了使用实体框架实体业​​务对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用实体框架的O / R映射器从微软和使用实体类作为一个业务对象(被映射到数据库对象生成的类)。 这个可以吗?请说出你的缺点或优点。如何才能在业务层和presentation,如何把这些对象作为数据成员?WCF之间的通信的情况

I'm using Entity Framework O/R mapper from Microsoft and using entity classes (generated classes that are mapped to DB objects) as a business objects. Is this OK? Please state your cons or pros. What to do in a case of WCF communication between business layer and presentation, how to send those objects as data members?

推荐答案

我以这种方式使用EF和一个不错的功能是生成实体部分类,允许进行扩展,是相当保护,再生一个方式来的问题。

I am using EF in this fashion and one nice feature is that generated entities are partial classes, allowing them to be extended in a way that is fairly protected from regeneration issues.

另外一起来看看 MSDN 这个链接,介绍了一些常见的使用场景与EF在关于业务逻辑。

Also take a look at this link on MSDN which describes some common usage scenarios with EF in regards to Business Logic.

这篇关于使用实体框架实体业​​务对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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