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

Return null in service but throw a exception No message returned from method. #36

Closed
ElderJames opened this issue Nov 1, 2019 · 4 comments

Comments

@ElderJames
Copy link
Contributor

I think the expected behavior should be returning null in client side

@mgravell
Copy link
Member

mgravell commented Nov 1, 2019

That's an interesting one, because protobuf has no concept of null, and no way to encode null. We could abuse headers, but I suspect that adds confusion because that would only work if both client and server knew about it, i.e. it would only work protobuf-net.Grpc to protobuf-net.Grpc

Frankly, I wonder if the best option is to leave it as-is. Thoughts?

@GoNextGroup
Copy link

Maybe, It's a solution to pass an "object" as a "null-value"?

@mgravell
Copy link
Member

mgravell commented Nov 1, 2019

An outer message with an optional inner message works well. That I can encode.

@mgravell
Copy link
Member

mgravell commented Jul 8, 2020

This is fundamentally not doable in the general case because protobuf has no null; I think the answer here is: "don't do that"

@mgravell mgravell closed this as completed Jul 8, 2020
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