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

TryGetDocumentId returns string on failure #10

Open
kierenj opened this issue Mar 30, 2015 · 2 comments
Open

TryGetDocumentId returns string on failure #10

kierenj opened this issue Mar 30, 2015 · 2 comments

Comments

@kierenj
Copy link

kierenj commented Mar 30, 2015

Being picky, but a Try* operation is expected to return a boolean indicating success or failure, with an output parameter to deal with the result. Returning a hardcoded string upon failure, which must be compared manually by the caller to a hardcoded string, seems a bad path to go down?

@g0t4
Copy link
Collaborator

g0t4 commented Mar 30, 2015

I'd suggest using TryGetValue("_id", out id); provided by the mongodb driver for that behavior.

@cd21h
Copy link

cd21h commented Mar 31, 2015

Agree with @g0t4

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

3 participants