Skip to content

ETag in response for single entity support in RESTier #22

@rayao

Description

@rayao
  • 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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions