Using Entity Framework entities as business objects?

前端 未结 7 1757
借酒劲吻你
借酒劲吻你 2020-11-30 20:34

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 s

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 21:29

    Can't you just re-attach the objects if they lose their original object context? You'd need to handle concurrency-issues yourself though.

    I wouldn't recommend using EF objects as DataContract objects for WCF, as you'd tie very strongly your implementation of entity objects to web service clients, change will be hard to do in the future, harder the more clients you plan on having.

提交回复
热议问题