问题描述
我正在使用 Microsoft 的实体框架 O/R 映射器,并将实体类(映射到 DB 对象的生成类)用作业务对象.这个可以吗?请说明你的缺点或优点.业务层和表现层之间的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.
这篇关于使用实体框架实体作为业务对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!