Table of Contents

Class ODataSerializer

Namespace
System.Web.Http.OData.Formatter.Serialization
Assembly
System.Web.Http.OData.dll

An ODataSerializer is used to write a CLR object to an ODataMessage.

public abstract class ODataSerializer
Inheritance
ODataSerializer
Derived
Inherited Members

Constructors

ODataSerializer(ODataPayloadKind)

Constructs an ODataSerializer that can generate OData payload of the specified kind.

protected ODataSerializer(ODataPayloadKind payloadKind)

Parameters

payloadKind ODataPayloadKind

The kind of OData payload that this serializer generates.

Properties

ODataPayloadKind

Gets the ODataPayloadKind that this serializer generates.

public ODataPayloadKind ODataPayloadKind { get; }

Property Value

ODataPayloadKind

Methods

WriteObject(object, Type, ODataMessageWriter, ODataSerializerContext)

Writes the given object specified by the parameter graph as a whole using the given messageWriter and writeContext.

public virtual void WriteObject(object graph, Type type, ODataMessageWriter messageWriter, ODataSerializerContext writeContext)

Parameters

graph object

The object to be written

type Type

The type of the object to be written.

messageWriter ODataMessageWriter

The Microsoft.Data.OData.ODataMessageWriter to be used for writing.

writeContext ODataSerializerContext

The ODataSerializerContext.