开发者

EF 4.0 Hibernate like saveupdate

开发者 https://www.devze.com 2023-02-22 08:12 出处:网络
I have silverlight application, where I use Entity Framework(PostgreSQL) and WCF(not RIA). Here is the problem:

I have silverlight application, where I use Entity Framework(PostgreSQL) and WCF(not RIA). Here is the problem:

in database I have table organization and table of contacts. Organization has set of contacts.

EF entity is not a data contract used by wcf. I use convertor to make datacontract from entity and vice versa. So my question is how to save related entiti开发者_如何学Goes like hibernate saveupdate(cascade="save-update")?


Entity framework doesn't have cascade updates. You must manually handle changes = you must manually decide which contracts were modified, which were added and also wich were deleted. MS decided to solve this inconvinience by introducing Self tracking entities but they are not always bullet proof and are harder to use in Silverlight because STEs code must be shared among client and server.

0

精彩评论

暂无评论...
验证码 换一张
取 消