IOutputFormatter Interface¶
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: - context (Microsoft.AspNet.Mvc.OutputFormatterContext) – The formatter context associated with the call.
- contentType (MediaTypeHeaderValue) – The desired contentType on the response.
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: - context (Microsoft.AspNet.Mvc.OutputFormatterContext) – The formatter context associated with the call.
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)
-