Interface IJsonOutputFormatter
Responsible for formatting output to Json
Namespace: EPiServer.Formatters
Assembly: EPiServer.Cms.AspNetCore.dll
Version: 12.0.3Syntax
public interface IJsonOutputFormatter : IOutputFormatter
Methods
CreateWriter(Stream, Encoding)
Creates a System.IO.TextWriter for the formatter.
Declaration
TextWriter CreateWriter(Stream stream, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to use |
System.Text.Encoding | encoding | The encoding for the writer |
Returns
Type | Description |
---|---|
System.IO.TextWriter | A writer. |
WriteAsync(OutputFormatterWriteContext, ResponseDecorator)
Write the object represented by context's Object property formatted to the specified writer
Declaration
Task WriteAsync(OutputFormatterWriteContext context, ResponseDecorator responseDecorator = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext | context | The context for the formatter |
ResponseDecorator | responseDecorator | An optional decorator that can be used to decorate the output |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task that serializes the value to the context's response message. |