Skip to content

Support for returning int code from non-task handlers

Choose a tag to compare

@JordanMarr JordanMarr released this 08 Apr 15:52
· 227 commits to main since this release

This release adds built-in support for return an int status code from synchronous handler functions.
S.CL already supports return Task<int> from asynchronous handlers, but return a status code from sync handlers requires injecting InvocationContext into your sync handler and setting the ExitCode property.

While v0.6.0 added support for injecting dependencies, this release aims to take this use case easier by injecting InvocationContext behind-the-scenes on the behalf of the user (at the expense of using one of the handler's 16 parameter slots).

See this example of returning a status code.