共用方式為


BrokeredMessage.GetBody Method

Definition

Overloads

GetBody<T>()

Deserializes the brokered message body into an object of the specified type by using the DataContractSerializer with a binary XmlDictionaryReader.

GetBody<T>(XmlObjectSerializer)

Deserializes the BrokeredMessage body into an object of the specified type using DataContractSerializer with a Binary XmlObjectSerializer.

GetBody<T>()

Deserializes the brokered message body into an object of the specified type by using the DataContractSerializer with a binary XmlDictionaryReader.

public T GetBody<T> ();
member this.GetBody : unit -> 'T
Public Function GetBody(Of T) () As T

Type Parameters

T

The type to which the message body will be deserialized.

Returns

T

The deserialized object or graph.

Exceptions

If the message is in disposed state or the message body stream is already disposed.

If the message contains a null body stream or the body stream contains no data or the message body has already been consumed.

Applies to

GetBody<T>(XmlObjectSerializer)

Deserializes the BrokeredMessage body into an object of the specified type using DataContractSerializer with a Binary XmlObjectSerializer.

public T GetBody<T> (System.Runtime.Serialization.XmlObjectSerializer serializer);
member this.GetBody : System.Runtime.Serialization.XmlObjectSerializer -> 'T
Public Function GetBody(Of T) (serializer As XmlObjectSerializer) As T

Type Parameters

T

Generic type parameter.

Parameters

serializer
XmlObjectSerializer

The serializer object.

Returns

T

The deserialized object/graph

Exceptions

Thrown if the message is in disposed state.

Thrown when invoked with a Null serializer object.

Thrown if the message contains a Null body stream, contains no data, or if the stream has been read once (through any GetBody() calls).

Applies to