Class JsonApiOutputFormatter
- Namespace
- JsonApiDotNetCore.Middleware
- Assembly
- JsonApiDotNetCore.dll
Application-wide entry point for writing JSON:API response bodies.
public sealed class JsonApiOutputFormatter : IJsonApiOutputFormatter, IOutputFormatter
- Inheritance
-
JsonApiOutputFormatter
- Implements
- Inherited Members
Methods
CanWriteResult(OutputFormatterCanWriteContext)
Determines whether this IOutputFormatter can serialize an object of the specified type.
public bool CanWriteResult(OutputFormatterCanWriteContext context)
Parameters
context
OutputFormatterCanWriteContextThe formatter context associated with the call.
Returns
- bool
Returns
true
if the formatter can write the response;false
otherwise.
WriteAsync(OutputFormatterWriteContext)
Writes the object represented by context
's Object property.
public Task WriteAsync(OutputFormatterWriteContext context)
Parameters
context
OutputFormatterWriteContextThe formatter context associated with the call.
Returns
- Task
A Task that serializes the value to the
context
's response message.