Table of Contents

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 OutputFormatterCanWriteContext

The 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 OutputFormatterWriteContext

The formatter context associated with the call.

selectedEncoding Encoding

The Encoding that should be used to write the response.

Returns

Task

A task which can write the response body.