Skip to main content

Definition

Assembly: Microsoft.Restier.AspNetCore.dll Namespace: Microsoft.Restier.AspNetCore.Formatter Inheritance: Microsoft.AspNet.OData.Formatter.Serialization.ODataPrimitiveSerializer

Syntax

Microsoft.Restier.AspNetCore.Formatter.RestierPrimitiveSerializer

Summary

The serializer for primitive result.

Constructors

.ctor

Initializes a new instance of the RestierPrimitiveSerializer class.

Syntax

public RestierPrimitiveSerializer(Microsoft.OData.ODataPayloadValueConverter payloadValueConverter)

Parameters

NameTypeDescription
payloadValueConverterMicrosoft.OData.ODataPayloadValueConverterThe ODataPayloadValueConverter to use.

Methods

CreateODataPrimitiveValue Override

Creates an ODataPrimitiveValue for the object represented by graph.

Syntax

public override Microsoft.OData.ODataPrimitiveValue CreateODataPrimitiveValue(object graph, Microsoft.OData.Edm.IEdmPrimitiveTypeReference primitiveType, Microsoft.AspNet.OData.Formatter.Serialization.ODataSerializerContext writeContext)

Parameters

NameTypeDescription
graphobjectThe primitive value.
primitiveTypeMicrosoft.OData.Edm.IEdmPrimitiveTypeReferenceThe EDM primitive type of the value.
writeContextMicrosoft.AspNet.OData.Formatter.Serialization.ODataSerializerContextThe serializer write context.

Returns

Type: Microsoft.OData.ODataPrimitiveValue The created ODataPrimitiveValue.

WriteObject Override

Writes the entity result to the response message.

Syntax

public override void WriteObject(object graph, System.Type type, Microsoft.OData.ODataMessageWriter messageWriter, Microsoft.AspNet.OData.Formatter.Serialization.ODataSerializerContext writeContext)

Parameters

NameTypeDescription
graphobjectThe entity result to write.
typeSystem.TypeThe type of the entity.
messageWriterMicrosoft.OData.ODataMessageWriterThe message writer.
writeContextMicrosoft.AspNet.OData.Formatter.Serialization.ODataSerializerContextThe writing context.

WriteObjectAsync Override

Writes the entity result to the response message asynchronously.

Syntax

public override System.Threading.Tasks.Task WriteObjectAsync(object graph, System.Type type, Microsoft.OData.ODataMessageWriter messageWriter, Microsoft.AspNet.OData.Formatter.Serialization.ODataSerializerContext writeContext)

Parameters

NameTypeDescription
graphobjectThe entity result to write.
typeSystem.TypeThe type of the entity.
messageWriterMicrosoft.OData.ODataMessageWriterThe message writer.
writeContextMicrosoft.AspNet.OData.Formatter.Serialization.ODataSerializerContextThe writing context.

Returns

Type: System.Threading.Tasks.Task A task representing the asynchronous operation.