Class Rule
- Namespace
- Dynamicweb.Ecommerce.Orders.Validation.Rules
- Assembly
- Dynamicweb.Ecommerce.dll
The class Rule represents validation rule.
[Serializable]
public abstract class Rule
- Inheritance
-
Rule
- Derived
- Inherited Members
Properties
Id
Gets or sets the rule id.
public string Id { get; set; }
Property Value
Parameters
Gets or sets rule parameters.
public abstract string Parameters { get; set; }
Property Value
ValidationId
Gets or sets Validation id.
public string ValidationId { get; set; }
Property Value
Methods
Delete()
Deletes this rule.
public void Delete()
Delete(bool)
Deletes this rule.
public void Delete(bool doKillCache)
Parameters
doKillCache
boolIndicates whether to clear the caches after delete.
GetRuleTypes()
Gets all the rule types.
public static List<Type> GetRuleTypes()
Returns
GetRuleTypes(bool)
Gets all the rule types.
public static List<Type> GetRuleTypes(bool doSort)
Parameters
doSort
boolIndicates whether to sort rules.
Returns
GetRules(string)
Gets rules for the provided Validation id.
public static RuleCollection GetRules(string ruleValidationId)
Parameters
ruleValidationId
stringThe validation id.
Returns
GetRules(string[])
Gets rules by provided ids.
public static RuleCollection GetRules(string[] ids)
Parameters
ids
string[]The rules ids.
Returns
GetRulesBySql(string)
Gets rules by sql query..
public static RuleCollection GetRulesBySql(string query)
Parameters
query
stringThe query.
Returns
Save()
Saves this rule.
public void Save()
Save(bool)
Saves this rule.
public void Save(bool doKillCache)
Parameters
doKillCache
boolIndicates whether to clear the caches after save.
TryParse(string, ref double)
protected bool TryParse(string value, ref double result)
Parameters
Returns
Validates(string)
Validates value with rule.
public abstract bool Validates(string value)
Parameters
value
stringThe value to validate.
Returns
- bool
Value indicating whether value valid according to rule.