ReferenceCodec.TryWriteReferenceField 方法

定义

重载

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

如果已写入并通过 进行跟踪,RecordObject(SerializerSession, Object)value编写对象引用。

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

如果已写入并通过 进行跟踪,RecordObject(SerializerSession, Object)value编写对象引用。 ///

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

如果已写入并通过 进行跟踪,RecordObject(SerializerSession, Object)value编写对象引用。

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

类型参数

TBufferWriter

缓冲区编写器类型。

参数

writer
Writer<TBufferWriter>

编写器。

fieldId
UInt32

字段标识符。

expectedType
Type

预期的类型。

value
Object

值。

返回

true 如果已写入引用,则为 ; false 否则为 。

适用于

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

如果已写入并通过 进行跟踪,RecordObject(SerializerSession, Object)value编写对象引用。 ///

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

类型参数

TBufferWriter

缓冲区编写器类型。

参数

writer
Writer<TBufferWriter>

编写器。

fieldId
UInt32

字段标识符。

expectedType
Type

预期的类型。

actualType
Type

实际类型。

value
Object

值。

返回

true 如果已写入引用,则为 ; false 否则为 。

注解

此重载允许为实现 IDerivedTypeCodec的编解码器指定固定引用类型。

适用于