FormatterMappings Class

Summary

Used to specify mapping between the URL Format and corresponding @!:MediaTypeHeaderValue-.

Syntax

public class FormatterMappings

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.FormatterMappings

Methods

ClearMediaTypeMappingForFormat(System.String)

Clears the @!:MediaTypeHeaderValue- mapping for the format.

Arguments:
  • format (System.String) – The format value.
Return type:

System.Boolean

Returns:

<c>true</c> if the format is successfully found and cleared; otherwise, <c>false</c>.

public bool ClearMediaTypeMappingForFormat(string format)
GetMediaTypeMappingForFormat(System.String)

Gets @!:MediaTypeHeaderValue- for the specified format.

Arguments:
  • format (System.String) – The format value.
Return type:

MediaTypeHeaderValue

Returns:

The @!:MediaTypeHeaderValue- for input format.

public MediaTypeHeaderValue GetMediaTypeMappingForFormat(string format)
SetMediaTypeMappingForFormat(System.String, MediaTypeHeaderValue)

Sets mapping for the format to specified @!:MediaTypeHeaderValue-. If the format already exists, the @!:MediaTypeHeaderValue- will be overwritten with the new value.

Arguments:
  • format (System.String) – The format value.
  • contentType (MediaTypeHeaderValue) – The @!:MediaTypeHeaderValue- for the format value.
public void SetMediaTypeMappingForFormat(string format, MediaTypeHeaderValue contentType)