Table of Contents

Class AsyncConvertEmptyActionResultFilter

Namespace
JsonApiDotNetCore.Middleware
Assembly
JsonApiDotNetCore.dll

Converts action result without parameters into action result with null parameter.

return NotFound() -> return NotFound(null)
This ensures our formatter is invoked, where we'll build a JSON:API compliant response. For details, see: https://github.com/dotnet/aspnetcore/issues/16969

public sealed class AsyncConvertEmptyActionResultFilter : IAsyncConvertEmptyActionResultFilter, IAsyncAlwaysRunResultFilter, IAsyncResultFilter, IFilterMetadata
Inheritance
AsyncConvertEmptyActionResultFilter
Implements
Inherited Members

Methods

OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate)

Called asynchronously before the action result.

public Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next)

Parameters

context ResultExecutingContext

The ResultExecutingContext.

next ResultExecutionDelegate

The ResultExecutionDelegate. Invoked to execute the next result filter or the result itself.

Returns

Task

A Task that on completion indicates the filter has executed.