protected override void Execute(Rules.IRuleContext context) { if (context.InputPropertyValues.ContainsKey(PrimaryProperty)) { context.AddErrorResult("PrimaryProperty has value."); } else { context.AddErrorResult("PrimaryProperty does not exist."); } }
protected override void Execute(Rules.IRuleContext context) { var target = (T)context.Target; if (target.ChildList.Count < 1) { context.AddErrorResult("At least one item required"); } }
protected override void Execute(Rules.IRuleContext context) { var v1 = (string)context.InputPropertyValues[PrimaryProperty]; var v2 = (string)context.InputPropertyValues[SecondaryProperty]; if (string.IsNullOrEmpty(v1) || string.IsNullOrEmpty(v2)) { context.AddErrorResult(string.Format("v1:{0}, v2:{1}", v1, v2)); } }
protected override void Execute(Rules.IRuleContext context) { context.AddErrorResult("Always error"); }
protected override void Execute(Rules.IRuleContext context) { context.AddErrorResult("Bad rule"); }