IInputFormatter Interface

Summary

Reads an object from the request body.

Syntax

public interface IInputFormatter

GitHub

View on GitHub

interface Microsoft.AspNet.Mvc.IInputFormatter

Methods

CanRead(Microsoft.AspNet.Mvc.InputFormatterContext)

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

Arguments:
Return type:

System.Boolean

Returns:

True if this [Microsoft.AspNet.Mvc.IInputFormatter](Microsoft.AspNet.Mvc.IInputFormatter.yml) supports the passed in request’s content-type and is able to de-serialize the request body. False otherwise.

bool CanRead(InputFormatterContext context)
ReadAsync(Microsoft.AspNet.Mvc.InputFormatterContext)

Called during deserialization to read an object from the request.

Arguments:
Return type:

System.Threading.Tasks.Task{System.Object}

Returns:

A task that deserializes the request body.

Task<object> ReadAsync(InputFormatterContext context)