8000 C# - How to return void on contract definition · Issue #938 · Cysharp/MagicOnion · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

C# - How to return void on contract definition #938

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

Open
renanfaccin opened this issue Mar 5, 2025 · 1 comment
Open

C# - How to return void on contract definition #938

renanfaccin opened this issue Mar 5, 2025 · 1 comment

Comments

@renanfaccin
Copy link

Using C# language to make GRPC calls with MagicOnion library, how to create a method that return void without to use UnaryResult struct? This struct force to inform a return type. I would like to create methods that returns nothing.

Thanks!

@mayuki
Copy link
Member
mayuki commented Mar 10, 2025

You must use UnaryResult for the return type of MagicOnion's Unary. If you are looking for something equivalent to void, you can use the generic UnaryResult.

In the case of async, you can return no value, and even if it is not async, you should return default or UnaryResult.CompletedResult.

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

2 participants
0