Class SqlRuleAction
- Namespace
- Microsoft.ServiceBus.Messaging
- Assembly
- Microsoft.ServiceBus.dll
Represents set of actions written in SQL language-based syntax that is performed against a BrokeredMessage.
[DataContract(Name = "SqlRuleAction", Namespace = "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect")]
public sealed class SqlRuleAction : RuleAction, IExtensibleDataObject
- Inheritance
-
SqlRuleAction
- Implements
-
IExtensibleDataObject
- Inherited Members
Constructors
SqlRuleAction(string)
Initializes a new instance of the SqlRuleAction class with the specified SQL expression.
public SqlRuleAction(string sqlExpression)
Parameters
sqlExpression
stringThe SQL expression.
SqlRuleAction(string, int)
Initializes a new instance of the SqlRuleAction class with the specified SQL expression and compatibility level.
public SqlRuleAction(string sqlExpression, int compatibilityLevel)
Parameters
sqlExpression
stringThe SQL expression.
compatibilityLevel
intReserved for future use. An integer value showing compatibility level. Currently hard-coded to 20.
Properties
CompatibilityLevel
This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20.
[DataMember(Name = "CompatibilityLevel", Order = 65538, EmitDefaultValue = false, IsRequired = false)]
public int CompatibilityLevel { get; }
Property Value
- int
An integer value showing the compatibility level
Parameters
Sets the value of a rule action.
public IDictionary<string, object> Parameters { get; }
Property Value
- IDictionary<string, object>
The value of a rule action.
RequiresPreprocessing
Gets a value indicating whether the SqlRuleAction requires preprocessing.
public override bool RequiresPreprocessing { get; }
Property Value
- bool
true if the SQL rule action requires preprocessing; otherwise, false. Currently always returns true.
SqlExpression
Gets the SQL expression.
[DataMember(Name = "SqlExpression", Order = 65537, EmitDefaultValue = false, IsRequired = true)]
public string SqlExpression { get; }
Property Value
- string
The SQL expression.
Methods
Execute(BrokeredMessage)
Executes the SqlRuleAction object.
public override BrokeredMessage Execute(BrokeredMessage message)
Parameters
message
BrokeredMessageThe BrokeredMessage to which the SqlRuleAction will be applied.
Returns
- BrokeredMessage
The processed BrokeredMessage.
Exceptions
- InvalidOperationException
Thrown when the operation is not valid for the current state.
Preprocess()
Gets the pre-processed RuleAction expression.
public override RuleAction Preprocess()
Returns
- RuleAction
The preprocessed RuleAction expression.
Exceptions
- RuleActionException
Thrown when the rule action statement is invalid or exceeds maximum allowed number of actions.
ToString()
Returns a string representation of SqlRuleAction.
public override string ToString()
Returns
- string
The string representation of SqlRuleAction.
Validate()
Validates the SQL expression against the SQL 92 syntax and rules.
public override void Validate()
Exceptions
- RuleActionException
Thrown when the rule action statement is invalid or exceeds maximum allowed number of actions.