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

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

问题描述

我正在使用Microsoft的Entity Framework O / R映射器,并将实体类(映射到DB对象的生成类)用作业务对象。
这样可以吗?请说明你的利弊。在业务层和演示文稿之间进行WCF通信的情况下如何处理,如何将这些对象作为数据成员发送?

解决方案

我以这种方式使用EF,一个很好的功能是生成的实体是部分类,允许它们以相当的方式被扩展,以免再生问题。



另外请查看 MSDN上的此链接,其中介绍了一些常见的使用场景EF关于业务逻辑。


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?

解决方案

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.

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天全站免登陆