Entity Framework & Self-Tracking Entities vs POCO

大憨熊 提交于 2019-12-01 06:41:40
Ladislav Mrnka

This is combination of too many questions and most of them were already asked on SO:

Using STEs will not make your upper layer dependent on EF but as described in second link STEs are not solution for every application. STEs have some other limitations, for example even on server side you cannot use lazy loading, you cannot apply changes when entity in the same key already exists in the context, etc.

Using POCOs and WCF means that you will work with detached entities and you will have to say EF what has changed. This can be simple in case of updating single entity and it is also possible to update only some fields from single entity but this can be very complex when updating the entity graph especially when you can delete relations on the client (in such case the easiest way is to load the entity graph first and merge incoming changes to attached entities).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!