/// <summary> /// Initializes a new instance of the <see cref="DeletionBusinessRule" /> class. /// </summary> /// <param name="tableName">Name of the table the rule is to be applied to.</param> /// <param name="ruleType">Severity of the rule violation</param> protected DeletionBusinessRule(string tableName, RuleViolationType ruleType) : base(tableName, ruleType) { }
/// <summary> /// Constructor /// </summary> /// <param name="fieldList">Field list (multiple fields can be separated by commas)</param> /// <param name="tableName">Table this object is responsible for.</param> /// <param name="message">Default message for broken rule</param> /// <param name="violationType">Type of the violation.</param> public EmptyFieldBusinessRule(string fieldList, string tableName, string message, RuleViolationType violationType) : base(tableName, violationType) { fields = fieldList; defaultMessage = message; var fieldCounter = StringHelper.Occurs(fieldList, ",") + 1; for (var counter = 0; counter < fieldCounter; counter++) { messages.Add(message); } }
/// <summary> /// Constructor /// </summary> /// <param name="tableName">Name of the table the rule is to be applied to.</param> /// <param name="ruleType">Severity of the rule violation</param> protected BusinessRule(string tableName, RuleViolationType ruleType = RuleViolationType.Violation) { TableName = tableName; violationType = ruleType; }
/// <summary> /// Constructor /// </summary> /// <param name="fieldList">Field list (multiple fields can be separated by commas)</param> /// <param name="tableName">Table this object is responsible for.</param> /// <param name="violationType">Severity of the violation</param> public EmptyFieldBusinessRule(string fieldList, string tableName, RuleViolationType violationType) : base(tableName, violationType) { fields = fieldList; messages.Add(defaultMessage); }