public RuleConstraintValue AddRuleConstraint(string left, string operation, string right) { var result = new RuleConstraintValue { Name = Utility.RandomString(10), Left = left, Operation = operation, Right = right }; RuleConstraintValues.Add(result); UpdateRuleConstraints(); return(result); }
public void UpdateRuleConstraint(string name, string left, string operation, string right) { if (RuleConstraintValues.All(x => x.Name != name)) { RuleConstraintValues.Add(new RuleConstraintValue { Name = name }); } var rc = RuleConstraintValues.First(x => x.Name == name); rc.Left = left; rc.Operation = operation; rc.Right = right; UpdateRuleConstraints(); }