Interface IHttpResponseHandler
Namespace: FunctionMonkey.Abstractions.Http
Assembly: FunctionMonkey.Abstractions.dll
Syntax
public interface IHttpResponseHandler
Methods
| Improve this Doc View SourceCreateResponse<TCommand>(TCommand)
Invoked when a command with no associated result is successfully invoked. Return an IActionResult for custom behaviour otherwise return null for the default framework behaviour.
Declaration
Task<IActionResult> CreateResponse<TCommand>(TCommand command)
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The command |
Returns
Type | Description |
---|---|
Task<IAction |
An action result or null for the default Function Monkey behaviour |
Type Parameters
Name | Description |
---|---|
TCommand | The type of the command |
CreateResponse<TCommand, TResult>(TCommand, TResult)
Invoked when a command with an associated result is successfully invoked. Return an IActionResult for custom behaviour otherwise return null for the default framework behaviour
Declaration
Task<IActionResult> CreateResponse<TCommand, TResult>(TCommand command, TResult result)
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The command |
TResult | result | The result |
Returns
Type | Description |
---|---|
Task<IAction |
An action result or null for the default Function Monkey behaviour |
Type Parameters
Name | Description |
---|---|
TCommand | The type of the command |
TResult | The type of the result |
CreateResponseFromException<TCommand>(TCommand, Exception)
Invoked when a command generates an exception during its execution. Return an IActionResult for custom behaviour otherwise return null for the default framework behaviour
Declaration
Task<IActionResult> CreateResponseFromException<TCommand>(TCommand command, Exception ex)
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The command |
Exception | ex | The exception that was thrown |
Returns
Type | Description |
---|---|
Task<IAction |
An action result or null for the default Function Monkey behaviour |
Type Parameters
Name | Description |
---|---|
TCommand | The type of the command |
CreateValidationFailureResponse<TCommand>(TCommand, ValidationResult)
Invoked when a command with a validator but no associated result is successfully invoked. Return an IActionResult for custom behaviour otherwise return null for the default framework behaviour.
Declaration
Task<IActionResult> CreateValidationFailureResponse<TCommand>(TCommand command, ValidationResult validationResult)
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The command |
Validation |
validationResult | The validation result |
Returns
Type | Description |
---|---|
Task<IAction |
An action result or null for the default Function Monkey behaviour |
Type Parameters
Name | Description |
---|---|
TCommand | The type of the command |