Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETag in response for single entity support in RESTier #22

Closed
rayao opened this issue Feb 9, 2015 · 2 comments
Closed

ETag in response for single entity support in RESTier #22

rayao opened this issue Feb 9, 2015 · 2 comments
Assignees
Milestone

Comments

@rayao
Copy link
Contributor

rayao commented Feb 9, 2015

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

@lewischeng-ms lewischeng-ms added this to the 0.5 milestone Nov 5, 2015
@chinadragon0515 chinadragon0515 self-assigned this Jun 29, 2016
@chinadragon0515 chinadragon0515 modified the milestones: 0.6, 0.5 Jun 29, 2016
@chinadragon0515 chinadragon0515 changed the title ETag support in RESTier ETag in response for single entity support in RESTier Jun 29, 2016
@chinadragon0515
Copy link
Contributor

Make changes for EntityResult to without wrapper any more. So EtagMessageHandler can be used.

For EntityCollectionResult, keep unchanged as it will not have etag header returned.

@chinadragon0515
Copy link
Contributor

Document updated, close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants