EF 4.0 Hibernate like saveupdate
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.
精彩评论