Edit

Share via


ReferenceCodec.TryWriteReferenceField Method

Definition

Overloads

TryWriteReferenceField<TBufferWriter>(Writer<TBufferWriter>, UInt32, Type, Object)

Write an object reference if value has already been written and has been tracked via RecordObject(SerializerSession, Object).

TryWriteReferenceField<TBufferWriter>(Writer<TBufferWriter>, UInt32, Type, Type, Object)

Write an object reference if value has already been written and has been tracked via RecordObject(SerializerSession, Object). ///

TryWriteReferenceField<TBufferWriter>(Writer<TBufferWriter>, UInt32, Type, Object)

Write an object reference if value has already been written and has been tracked via RecordObject(SerializerSession, Object).

public static bool TryWriteReferenceField<TBufferWriter> (ref Orleans.Serialization.Buffers.Writer<TBufferWriter> writer, uint fieldId, Type expectedType, object value) where TBufferWriter : System.Buffers.IBufferWriter<byte>;
static member TryWriteReferenceField : Writer * uint32 * Type * obj -> bool (requires 'BufferWriter :> System.Buffers.IBufferWriter<byte>)
Public Shared Function TryWriteReferenceField(Of TBufferWriter As IBufferWriter(Of Byte)) (ByRef writer As Writer(Of TBufferWriter), fieldId As UInteger, expectedType As Type, value As Object) As Boolean

Type Parameters

TBufferWriter

The buffer writer type.

Parameters

writer
Writer<TBufferWriter>

The writer.

fieldId
UInt32

The field identifier.

expectedType
Type

The expected type.

value
Object

The value.

Returns

true if a reference was written, false otherwise.

Applies to

TryWriteReferenceField<TBufferWriter>(Writer<TBufferWriter>, UInt32, Type, Type, Object)

Write an object reference if value has already been written and has been tracked via RecordObject(SerializerSession, Object). ///

public static bool TryWriteReferenceField<TBufferWriter> (ref Orleans.Serialization.Buffers.Writer<TBufferWriter> writer, uint fieldId, Type expectedType, Type actualType, object value) where TBufferWriter : System.Buffers.IBufferWriter<byte>;
static member TryWriteReferenceField : Writer * uint32 * Type * Type * obj -> bool (requires 'BufferWriter :> System.Buffers.IBufferWriter<byte>)
Public Shared Function TryWriteReferenceField(Of TBufferWriter As IBufferWriter(Of Byte)) (ByRef writer As Writer(Of TBufferWriter), fieldId As UInteger, expectedType As Type, actualType As Type, value As Object) As Boolean

Type Parameters

TBufferWriter

The buffer writer type.

Parameters

writer
Writer<TBufferWriter>

The writer.

fieldId
UInt32

The field identifier.

expectedType
Type

The expected type.

actualType
Type

The actual type.

value
Object

The value.

Returns

true if a reference was written, false otherwise.

Remarks

This overload allows specifying a fixed reference type for codecs that implement IDerivedTypeCodec.

Applies to