Can ASP.NET Core WebAPI Actions have void return types?

ASP.NET Core WebAPI actions CAN have void return types. The framework returns an EmptyResult for such actions with a default 200 (OK) status Code.

This can be particularly observed in the cases of HttpDelete operations where no return is expected by the client in most cases.

ASP.NET Core WebAPI actions CAN have void return types. The framework returns an EmptyResult for such actions with a default 200 (OK) status Code.

This can be particularly observed in the cases of HttpDelete operations where no return is expected by the client in most cases.


Buy Me A Coffee

Found this article helpful? Please consider supporting!

Ram
Ram

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity. You can connect with me on Medium, Twitter or LinkedIn.

Leave a Reply

Your email address will not be published. Required fields are marked *