IOutputFormatter Interface

Summary

Writes an object to the output stream.

Syntax

public interface IOutputFormatter

GitHub

View on GitHub

interface Microsoft.AspNet.Mvc.IOutputFormatter

Methods

CanWriteResult(Microsoft.AspNet.Mvc.OutputFormatterContext, MediaTypeHeaderValue)

Determines whether this [Microsoft.AspNet.Mvc.IOutputFormatter](Microsoft.AspNet.Mvc.IOutputFormatter.yml) can serialize an object of the specified type.

Arguments:
Return type:

System.Boolean

Returns:

True if this [Microsoft.AspNet.Mvc.IOutputFormatter](Microsoft.AspNet.Mvc.IOutputFormatter.yml) supports the passed in <paramref name=”contentType” /> and is able to serialize the object represent by <paramref name=”context” />’s Object property. False otherwise.

bool CanWriteResult(OutputFormatterContext context, MediaTypeHeaderValue contentType)
WriteAsync(Microsoft.AspNet.Mvc.OutputFormatterContext)

Writes the object represented by <paramref name=”context” />’s Object property.

Arguments:
Return type:

System.Threading.Tasks.Task

Returns:

A Task that serializes the value to the <paramref name=”context” />’s response message.

Task WriteAsync(OutputFormatterContext context)