HTML Client - How to DELETE via OData using ETags RRS feed

  • Question

  • Hi LightSwitchers,

    This could be a facepalm moment but I'm hoping someone could please explain how to delete via a LightSwitch OData service?

    I'm experimenting with a custom grid bound to an OData service (eg. /ApplicationData.svc/Documents).  The grid populates with data.  Success!  My next step was to try to delete an item but I was presented with the error message below:

    Only 'If-Match' headers are supported for Update/Delete operations.

    I did some reading about If-Match headers, ETags and RowVersions and I'm not sure of how to proceed. My understanding is that an ETag is not returned in the response with an entity collection.  If I submit a request for a single item (eg. /ApplicationData.svc/Documents(Id)), an ETag will be returned in the response.  Since my grid already has the data (returned as a collection) and I have no ETags to send back with a DELETE request, how do I populate the If-Match header?  I've seen references to If-Match *.  Is this the only option for this scenario?  Are there better ways to handle this?  Is this lazy?

    Thursday, April 17, 2014 12:20 PM


All replies