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

New Feature: Add support for void returns #65

Closed
csteele86 opened this issue Jul 9, 2021 · 4 comments
Closed

New Feature: Add support for void returns #65

csteele86 opened this issue Jul 9, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@csteele86
Copy link
Contributor

Currently, Result enforces that it is of a specific type. This does not allow for times when no value is returned from a function (i.e., typically a delete or an update). Having this would allow us to still utilize the useful features of Result. From an API perspective, this would then become an HTTP 201 No Content.

@ardalis
Copy link
Owner

ardalis commented Jul 9, 2021

I looked into this, see #41.

It didn't work out; right now I forget what the main blockers were but I spent a bunch of hours on it and couldn't make it work the way I wanted to have both the generic and non-generic versions exist side by side. The way other similar frameworks handle this is by introducing a type that means "no return" like MediatR and its "Unit" type.

If folks think that would be a good general solution here, I could include such a type, and docs for how to use it, in this package. What do you think?

@csteele86
Copy link
Contributor Author

Yeah, I spent a little time trying to figure it out as well and ran into complications. I believe a good first place to start would be to have something. The way I've made it work in the solution we've adopted this package for sounds like the same way the other solutions have made it work.

@ardalis
Copy link
Owner

ardalis commented Aug 13, 2021

@ardalis
Copy link
Owner

ardalis commented May 25, 2024

I think this is done - reopen if there are still use cases not covered.

@ardalis ardalis closed this as completed May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants