Appearance
PayloadResult Class
Definition
Represents an MVC action result that serializes either a normal response payload or an RFC 9457 ProblemDetails payload using the configured IActionResultSerializer.
- Namespace:
JASE.Web - Assembly:
JASE.Web.dll
Properties
| Name | Description |
|---|---|
Problem | Gets the RFC 9457 problem details payload to serialize into the response body when the result |
StatusCode | Gets the HTTP status code that will be written to the response. |
Value | Gets the object value to serialize into the response body for a non-problem response. |
Methods
| Name | Description |
|---|---|
Task ExecuteResultAsync(ActionContext context) | |
PayloadResult Failure(ProblemDetails problem) | Creates a failed PayloadResult using the specified RFC 9457 ProblemDetails payload. |
PayloadResult Success(object value = null, int statusCode = null) | Creates a successful PayloadResult with the specified response payload. |
Remarks
This result is intended for API-facing code that needs to return a framework-compatible IActionResult without directly depending on MVC's built-in output formatter pipeline.
The response body format is determined by the resolved IActionResultSerializer, which may choose an appropriate representation such as JSON or CBOR based on the current request.