ETagMessageHandler (in System.Web.OData) will verify the returned HttpContent is ObjectContent and its ObjectContent.Value matches the EntityType, if will add Etag header, and if not it won’t add the ETag header.
Unfortunately, RestierController will wrap the entity object in an instance of EntityResult, ETagMessageHandler has no clue of that type, so it won’t emit ETag header even it is an entity type result.
Now the question is:
What’s the purpose of EntityResult and EntityCollectionResult? Why not return the entity or entity collection directly?
If we must keep EntityResult and EntityCollectionResult, we'd have to implement another etag handler to add the ETag header into response.
The text was updated successfully, but these errors were encountered:
Now the question is:
If we must keep EntityResult and EntityCollectionResult, we'd have to implement another etag handler to add the ETag header into response.
The text was updated successfully, but these errors were encountered: