WCF Data Services and Self Tracking Entities
I have seen a couple of references stating that WCF Data Servic开发者_Go百科es handles change tracking automatically. Does that mean you don't need to create Self Tracking Entities (STE) and it works automatically with any entity object type? Sorry, a bit confused here and have been struggling to find a resource that clears this up for me.
Thanks
WCF Data Services has an explicit (i.e. you tell the DataServiceContext
what has changed) model.
However if you are using a DataServiceCollection<>
- which is often the case - and making changes through it, then it takes care of telling the DataServiceContext
what has happened for you.
Then when you call DataServiceContext.SaveChanges()
your changes are pushed to the server.
As for Self Tracking Entities (STEs) they don't work with WCF Data Services because the materialization of objects off the wire (from OData format) and the STE's fixup logic are incompatible.
精彩评论