ODataMediaTypeFormatter Class

Represents the MediaTypeFormatter class to handle OData.

Inheritance Hierarchy

System.Object
  System.Net.Http.Formatting.MediaTypeFormatter
    System.Web.Http.OData.Formatter.ODataMediaTypeFormatter

Namespace:  System.Web.Http.OData.Formatter
Assembly:  System.Web.Http.OData (in System.Web.Http.OData.dll)

Syntax

'Declaration
Public Class ODataMediaTypeFormatter _
    Inherits MediaTypeFormatter
'Usage
Dim instance As ODataMediaTypeFormatter
public class ODataMediaTypeFormatter : MediaTypeFormatter
public ref class ODataMediaTypeFormatter : public MediaTypeFormatter
type ODataMediaTypeFormatter =  
    class 
        inherit MediaTypeFormatter 
    end
public class ODataMediaTypeFormatter extends MediaTypeFormatter

The ODataMediaTypeFormatter type exposes the following members.

Constructors

  Name Description
Public method ODataMediaTypeFormatter(IEnumerable<ODataPayloadKind>) Initializes a new instance of the ODataMediaTypeFormatter class.
Public method ODataMediaTypeFormatter(ODataDeserializerProvider, ODataSerializerProvider, IEnumerable<ODataPayloadKind>) Initializes a new instance of the ODataMediaTypeFormatter class.

Top

Properties

  Name Description
Public property DeserializerProvider Gets the ODataDeserializerProvider that will be used by this formatter instance.
Public property MediaTypeMappings (Inherited from MediaTypeFormatter.)
Public property MessageReaderQuotas Gets or sets the ODataMessageQuotas that this formatter uses on the reader side.
Public property MessageReaderSettings Gets the settings to be use while reading requests.
Public property MessageWriterQuotas Gets or sets the ODataMessageQuotas that this formatter uses on the writer side.
Public property MessageWriterSettings Gets the settings to be use while writing responses.
Public property RequiredMemberSelector (Inherited from MediaTypeFormatter.)
Public property SerializerProvider Gets the ODataSerializerProvider that will be used by this formatter instance.
Public property SupportedEncodings (Inherited from MediaTypeFormatter.)
Public property SupportedMediaTypes (Inherited from MediaTypeFormatter.)

Top

Methods

  Name Description
Public method CanReadType Queries whether this MediaTypeFormatter can deserialize an object of the specified type. (Overrides MediaTypeFormatter.CanReadType(Type).)
Public method CanWriteType Queries whether this MediaTypeFormatter can serialize an object of the specified type. (Overrides MediaTypeFormatter.CanWriteType(Type).)
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetPerRequestFormatterInstance Returns a specialized instance of the MediaTypeFormatter that can format a response for the given parameters. (Overrides MediaTypeFormatter.GetPerRequestFormatterInstance(Type, HttpRequestMessage, MediaTypeHeaderValue).)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger) Asynchronously deserializes an object of the specified type. (Overrides MediaTypeFormatter.ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger).)
Public method ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger, CancellationToken) (Inherited from MediaTypeFormatter.)
Public method SelectCharacterEncoding (Inherited from MediaTypeFormatter.)
Public method SetDefaultContentHeaders Sets the default headers for content that will be formatted using this formatter. This method is called from the ObjectContent constructor. This implementation sets the Content-Type header to the value of mediaType if it is not null. If it is null it sets the Content-Type to the default media type of this formatter. If the Content-Type does not specify a charset it will set it using this formatters configured Encoding. (Overrides MediaTypeFormatter.SetDefaultContentHeaders(Type, HttpContentHeaders, MediaTypeHeaderValue).)
Public method ToString (Inherited from Object.)
Public method WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext) (Inherited from MediaTypeFormatter.)
Public method WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext, CancellationToken) Asynchronously writes an object of the specified type. (Overrides MediaTypeFormatter.WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext, CancellationToken).)

Top

Remarks

No content here will be updated; please do not add material here.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Web.Http.OData.Formatter Namespace