Class MessageProcessingExtensions
Provides extension helper methods relates to a message processing pipeline.
Inheritance
Inherited Members
Namespace: Nevatech.Vsb.Repository.Processing
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public static class MessageProcessingExtensions
Fields
ContextPropertyTokenFormat
Regular expression used for matching tokens representing context property's names that need to be replaced with corresponding property's values. The token format is "<{Property Name}>".
Declaration
public static readonly Regex ContextPropertyTokenFormat
Field Value
Type | Description |
---|---|
System.Text.RegularExpressions.Regex |
Methods
HasContextPropertyTokens(String)
Returns flag indicating that provided value contains specially formatted context property names.
Declaration
public static bool HasContextPropertyTokens(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | String value that may contain one or more tokens specifying context properties. |
Returns
Type | Description |
---|---|
System.Boolean | True, if at least one token is found, otherwise returns False. |
ReplaceContextPropertyTokens(RoutingContextMessageProperty, String, Boolean)
Finds all specially formatted context property names in the specified string and replaces them with context property values found in the provided routing context.
Declaration
public static string ReplaceContextPropertyTokens(RoutingContextMessageProperty routingContext, string value, bool removeUnresolvedTokens)
Parameters
Type | Name | Description |
---|---|---|
RoutingContextMessageProperty | routingContext | Routing context message property to be used for extracting context properties. |
System.String | value | String value that may contain one or more tokens specifying context properties. |
System.Boolean | removeUnresolvedTokens | Flag indicating that tokens, for which context properties are not found, should be removed from the provided value. If False then tokens will be left in the value intact. |
Returns
Type | Description |
---|---|
System.String | Original |
ReplaceContextPropertyTokens(MessagePipelineContext, String)
Finds all specially formatted context property names in the specified string and replaces them with context property values found in the provided message processing context.
Declaration
public static string ReplaceContextPropertyTokens(this MessagePipelineContext context, string value)
Parameters
Type | Name | Description |
---|---|---|
MessagePipelineContext | context | Message processing pipeline context to be used for extracting context properties. |
System.String | value | String value that may contain one or more tokens specifying context properties. |
Returns
Type | Description |
---|---|
System.String | Original |
TryGetContextProperty(Message, String, out String)
Retrieves a context property value from provided message. Non string value is converted to string.
Declaration
public static bool TryGetContextProperty(this Message message, string name, out string value)
Parameters
Type | Name | Description |
---|---|---|
System.ServiceModel.Channels.Message | message | Message being processed and to be used for extracting context property. |
System.String | name | Name of the context property to be retrieved. |
System.String | value | Value of the property. |
Returns
Type | Description |
---|---|
System.Boolean | Flag indicating that property has been found and its value has been extracted. |
TryGetContextProperty(MessageProperties, String, out String)
Retrieves a context property value from provided context properties collection. Non string value is converted to string.
Declaration
public static bool TryGetContextProperty(this MessageProperties properties, string name, out string value)
Parameters
Type | Name | Description |
---|---|---|
System.ServiceModel.Channels.MessageProperties | properties | Context properties collection (not a message properties collection) to retrieve a value from. |
System.String | name | Name of the context property to be retrieved. |
System.String | value | Value of the property. |
Returns
Type | Description |
---|---|
System.Boolean | Flag indicating that property has been found and its value has been extracted. |