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

Comments

Projects
None yet
4 participants
@rayao
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

@lewischeng-ms lewischeng-ms added feature and removed improvement labels Nov 5, 2015

@chinadragon0515 chinadragon0515 added ready and removed backlog labels Apr 20, 2016

@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 from ETag support in RESTier to ETag in response for single entity support in RESTier Jun 29, 2016

@chinadragon0515

This comment has been minimized.

Contributor

chinadragon0515 commented Jul 4, 2016

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

This comment has been minimized.

Contributor

chinadragon0515 commented Jul 12, 2016

Document updated, close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment