Skip to main content

Definition

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

Syntax

Microsoft.Restier.AspNet.Formatter.RestierResourceSerializer

Summary

The serializer for resource result, and now for complex only, for entity type, WebApi OData resource serializer will be used.

Constructors

.ctor

Initializes a new instance of the RestierResourceSerializer class.

Syntax

public RestierResourceSerializer(Microsoft.AspNet.OData.Formatter.Serialization.ODataSerializerProvider provider)

Parameters

NameTypeDescription
providerMicrosoft.AspNet.OData.Formatter.Serialization.ODataSerializerProviderThe serializer provider.

Methods

WriteObject Override

Writes the complex 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 complex result to write.
typeSystem.TypeThe type of the complex.
messageWriterMicrosoft.OData.ODataMessageWriterThe message writer.
writeContextMicrosoft.AspNet.OData.Formatter.Serialization.ODataSerializerContextThe writing context.

WriteObjectAsync Override

Writes the complex 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 complex result to write.
typeSystem.TypeThe type of the complex.
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.