Skip to content

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 ​

NameDescription
ProblemGets the RFC 9457 problem details payload to serialize into the response body when the result
StatusCodeGets the HTTP status code that will be written to the response.
ValueGets the object value to serialize into the response body for a non-problem response.

Methods ​

NameDescription
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.