且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用实体框架实体作为业务对象?

更新时间:2023-02-17 20:07:47

我以这种方式使用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.