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

DataServiceQuerySingle<T>.GetValueAsync inconsistent with GetValue in support for GET returning 404 #698

Closed
skottmckay opened this issue Aug 28, 2016 · 1 comment

Comments

@skottmckay
Copy link

Using GetValueAsync throws if the request is reading a single entity and that entity is not found, and IgnoreResourceNotFoundException is set to true.

GetValue works as expected.

The different is that GetValue calls SingleOrDefault(), and EndGetValue (used by GetValueAsync) calls Single(). The usage of Single leads to an InvalidOperationException as the sequence has no elements due to the entity not being found.

OData Client v4.6

@patrickmichalina
Copy link

Hit with this error as well!

@AlanWong-MS AlanWong-MS added the P4 label May 31, 2017
0xced added a commit to 0xced/odata.net that referenced this issue Sep 8, 2017
Use SingleOrDefault() instead of Single() to get the same behavior as GetValue.

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

No branches or pull requests

4 participants