IMessageFilterTable<TFilterData>.GetMatchingFilters Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds the filters whose query criteria are satisfied by a specified message or buffered message to a collection.
Overloads
GetMatchingFilters(Message, ICollection<MessageFilter>) |
Returns a value that indicates whether the match criterion of a filter in the table is satisfied by the specified message, and adds the matching filters to a collection. |
GetMatchingFilters(MessageBuffer, ICollection<MessageFilter>) |
Returns a value that indicates whether the match criterion of a filter in the table is satisfied by the specified buffered message, and adds the matching filters to a collection. |
Remarks
Use one of these methods when more than one filter is expected to match the message and the matching filters are required. Note that the collection that contains the filters is not cleared before the results are added. This allows you to accumulate all matches across multiple filter tables into a single collection.
If the body of the message must be inspected by a filter in the filter table, buffer the message and pass it to the GetMatchingFilters method. Otherwise, use GetMatchingFilters.
The matching MessageFilter objects are stored in the results
parameter. The filter data can then be recovered from the filter table using these filters as keys with the methods provided by IDictionary<TKey,TValue>.
GetMatchingFilters(Message, ICollection<MessageFilter>)
- Source:
- IMessageFilterTable.cs
- Source:
- IMessageFilterTable.cs
- Source:
- IMessageFilterTable.cs
Returns a value that indicates whether the match criterion of a filter in the table is satisfied by the specified message, and adds the matching filters to a collection.
public:
bool GetMatchingFilters(System::ServiceModel::Channels::Message ^ message, System::Collections::Generic::ICollection<System::ServiceModel::Dispatcher::MessageFilter ^> ^ results);
public bool GetMatchingFilters (System.ServiceModel.Channels.Message message, System.Collections.Generic.ICollection<System.ServiceModel.Dispatcher.MessageFilter> results);
abstract member GetMatchingFilters : System.ServiceModel.Channels.Message * System.Collections.Generic.ICollection<System.ServiceModel.Dispatcher.MessageFilter> -> bool
Public Function GetMatchingFilters (message As Message, results As ICollection(Of MessageFilter)) As Boolean
Parameters
- results
- ICollection<MessageFilter>
Reference parameter that stores the MessageFilter objects that match in ICollection<T><Filter>.
Returns
true
if the match criterion of at least one filter in the table is satisfied by message
; false
if no filter is satisfied.
Remarks
Use this method when more than one filter is expected to match the message, the matching filters are required, and the body of the message does not have to be inspected.
Notes to Implementers
This version takes a Message and must throw an InvalidBodyAccessException if it tries to examine the message body.
Applies to
GetMatchingFilters(MessageBuffer, ICollection<MessageFilter>)
- Source:
- IMessageFilterTable.cs
- Source:
- IMessageFilterTable.cs
- Source:
- IMessageFilterTable.cs
Returns a value that indicates whether the match criterion of a filter in the table is satisfied by the specified buffered message, and adds the matching filters to a collection.
public:
bool GetMatchingFilters(System::ServiceModel::Channels::MessageBuffer ^ messageBuffer, System::Collections::Generic::ICollection<System::ServiceModel::Dispatcher::MessageFilter ^> ^ results);
public bool GetMatchingFilters (System.ServiceModel.Channels.MessageBuffer messageBuffer, System.Collections.Generic.ICollection<System.ServiceModel.Dispatcher.MessageFilter> results);
abstract member GetMatchingFilters : System.ServiceModel.Channels.MessageBuffer * System.Collections.Generic.ICollection<System.ServiceModel.Dispatcher.MessageFilter> -> bool
Public Function GetMatchingFilters (messageBuffer As MessageBuffer, results As ICollection(Of MessageFilter)) As Boolean
Parameters
- messageBuffer
- MessageBuffer
The MessageBuffer to test.
- results
- ICollection<MessageFilter>
Reference parameter that stores the MessageFilter objects that match in ICollection<T><Filter>.
Returns
true
if the match criterion of at least one filter in the table is satisfied by messageBuffer
; false
if no filter is satisfied.
Remarks
Use this method when more than one filter is expected to match the buffered message, the matching filter is required, and the body of the message may have to be inspected.