Class SimpleExprValidator
Inheritance
Implements
Inherited Members
Namespace: Mediachase.Commerce.Marketing.Validators
Assembly: Mediachase.Commerce.Marketing.Validators.dll
Version: 10.8.0Syntax
public class SimpleExprValidator : IExpressionValidator
Constructors
SimpleExprValidator()
Initializes a new instance of the SimpleExprValidator class.
Declaration
public SimpleExprValidator()
Methods
Eval(String, String, IDictionary<String, Object>)
Validates the xml string and compares it to existing profile. The xml string must have the following format:
<Profile> <propertyCondition name="Profile" required="true|false"> <Parameter name="operator" value="=|!=|contains|doesNotContain"/> <Parameter name="propertyName" value="propertyName"/> <Parameter name="propertyValue" value="propertyValue"/> </propertyCondition> </Profile>
Condition.Name should correspond to the object in the context dictionary with a same name.
Declaration
public virtual ValidationResult Eval(string key, string expr, IDictionary<string, object> context)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. Must be a unique key identifying the current expression. It might be used for caching purpose by the engine. |
System.String | expr | The expression that needs to be evaluated. |
System.Collections.Generic.IDictionary<System.String, System.Object> | context | The context, which consists of object that will be accessible during expression evaluation. |
Returns
Type | Description |
---|---|
ValidationResult |