Serialization Support for Delta Feed
This sample will introduce how to create a Delta Feed which is serialized into a Delta Response in Web API OData V4.
EdmEntityObjectCollection, Web API OData V5.6 now has an
EdmChangedObjectCollection to represent a collection of objects which can be a part of the Delta Feed.
A delta response can contain new/changed entities, deleted entities, new links or deleted links.
WebAPI OData V4 now has
EdmDeltaDeletedLink respectively for the objects that can be a part of the Delta response.
All the above objects implement the
IEdmChangedObject interface, while the
EdmChangedObjectCollection is a collection of
For example, if user defines a model as:
EdmChangedObjectCollection collection for Customer entity will be created as follows:
Changed or Modified objects are added as
Deleted objects are added as
Delta Link is added corresponding to a $expand in the initial request, these are added as
Deleted Links is added for each deleted link that corresponds to a $expand path in the initial request, these are added as
Sample for Delta Feed
Let’s create a controller to return a Delta Feed:
Now, user can issue a GET request as:
The corresponding payload will has the following contents: