Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Data Services and Self Tracking Entities

I have seen a couple of references stating that WCF Data Services 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

like image 287
Jon Archway Avatar asked Oct 25 '10 10:10

Jon Archway


1 Answers

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.

like image 113
Alex James Avatar answered Oct 05 '22 09:10

Alex James