Class JsonLinesStreamingFormatter
- Namespace
- Cratis.Applications.Queries
- Assembly
- Cratis.Applications.dll
Represents a formatter for streaming JSON lines.
public class JsonLinesStreamingFormatter : TextOutputFormatter, IOutputFormatter, IApiResponseTypeMetadataProvider
- Inheritance
-
JsonLinesStreamingFormatter
- Implements
- Inherited Members
Constructors
JsonLinesStreamingFormatter()
Initializes a new instance of the JsonLinesStreamingFormatter class.
public JsonLinesStreamingFormatter()
Methods
CanWriteResult(OutputFormatterCanWriteContext)
Determines whether this IOutputFormatter can serialize an object of the specified type.
public override 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.
WriteResponseBodyAsync(OutputFormatterWriteContext, Encoding)
Writes the response body.
public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
Parameters
context
OutputFormatterWriteContextThe formatter context associated with the call.
selectedEncoding
EncodingThe Encoding that should be used to write the response.
Returns
- Task
A task which can write the response body.