Skip to main content

Definition

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

Syntax

Microsoft.Restier.AspNetCore.Formatter.RestierCollectionSerializer

Summary

The serializer for collection result.

Constructors

.ctor

Initializes a new instance of the RestierCollectionSerializer class.

Syntax

public RestierCollectionSerializer(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 collection result to write.
typeSystem.TypeThe type of the collection.
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 collection result to write.
typeSystem.TypeThe type of the collection.
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.