Class AsyncConvertEmptyActionResultFilter
- Namespace
- JsonApiDotNetCore.Middleware
- Assembly
- JsonApiDotNetCore.dll
Converts action result without parameters into action result with null parameter.
public sealed class AsyncConvertEmptyActionResultFilter : IAsyncConvertEmptyActionResultFilter, IAsyncAlwaysRunResultFilter, IAsyncResultFilter, IFilterMetadata
- Inheritance
-
AsyncConvertEmptyActionResultFilter
- Implements
- Inherited Members
Remarks
This basically turns calls such as
return NotFound()
into
return NotFound(null)
, so that our formatter is invoked, where we'll build a JSON:API compliant response. For details, see:
https://github.com/dotnet/aspnetcore/issues/16969
Methods
OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate)
Called asynchronously before the action result.
public Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next)
Parameters
contextResultExecutingContextnextResultExecutionDelegateThe ResultExecutionDelegate. Invoked to execute the next result filter or the result itself.