使用实体框架实体作为业务对象? [英] Using Entity Framework entities as business objects?
问题描述
这样可以吗?请说明你的利弊。在业务层和演示文稿之间进行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屋!