Modifica

Condividi tramite


MessageQueryCollection.Evaluate Method

Definition

Runs a query against the message and returns a value that satisfies the query.

Overloads

Evaluate<TResult>(Message)

Runs a query against the message and returns a result. The body cannot be queried.

Evaluate<TResult>(MessageBuffer)

Runs a query against the message and returns a result.

Remarks

The difference between the two overloads is that one takes a Message parameter and is not permitted to examine the body. The other takes a MessageBuffer parameter and can examine any part of the message. Message headers are automatically buffered and can be queried without being consumed. However, if the body is to be queried, then the entire message must be buffered because an unbuffered message body can be consumed by the query.

Evaluate<TResult>(Message)

Runs a query against the message and returns a result. The body cannot be queried.

public:
generic <typename TResult>
 abstract System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::ServiceModel::Dispatcher::MessageQuery ^, TResult>> ^ Evaluate(System::ServiceModel::Channels::Message ^ message);
public abstract System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.ServiceModel.Dispatcher.MessageQuery,TResult>> Evaluate<TResult> (System.ServiceModel.Channels.Message message);
abstract member Evaluate : System.ServiceModel.Channels.Message -> seq<System.Collections.Generic.KeyValuePair<System.ServiceModel.Dispatcher.MessageQuery, 'Result>>
Public MustOverride Function Evaluate(Of TResult) (message As Message) As IEnumerable(Of KeyValuePair(Of MessageQuery, TResult))

Type Parameters

TResult

The type of the result of the query.

Parameters

message
Message

The message to run the query against.

Returns

The result of the query. The type is determined by the generic TResult argument.

Applies to

Evaluate<TResult>(MessageBuffer)

Runs a query against the message and returns a result.

public:
generic <typename TResult>
 abstract System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::ServiceModel::Dispatcher::MessageQuery ^, TResult>> ^ Evaluate(System::ServiceModel::Channels::MessageBuffer ^ buffer);
public abstract System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.ServiceModel.Dispatcher.MessageQuery,TResult>> Evaluate<TResult> (System.ServiceModel.Channels.MessageBuffer buffer);
abstract member Evaluate : System.ServiceModel.Channels.MessageBuffer -> seq<System.Collections.Generic.KeyValuePair<System.ServiceModel.Dispatcher.MessageQuery, 'Result>>
Public MustOverride Function Evaluate(Of TResult) (buffer As MessageBuffer) As IEnumerable(Of KeyValuePair(Of MessageQuery, TResult))

Type Parameters

TResult

The type of the object to return.

Parameters

buffer
MessageBuffer

The message to run the query against.

Returns

The result of the query. The type is determined by the generic TResult argument.

Applies to