示例#1
0
            protected override void Execute(Rules.IRuleContext context)
            {
#pragma warning disable CS0436 // Type conflicts with imported type
                // TODO: Not sure how to replicate this functionality in Csla 6
                // ((LocationBusinessBase)context.Target).Rule = ApplicationContext.LogicalExecutionLocation.ToString();
#pragma warning restore CS0436 // Type conflicts with imported type
            }
示例#2
0
            protected override void Execute(Rules.IRuleContext context)
            {
                var target = (T)context.Target;

                if (target.ChildList.Count < 1)
                {
                    context.AddErrorResult("At least one item required");
                }
            }
示例#3
0
        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));
            }
        }
示例#4
0
 protected override void Execute(Rules.IRuleContext context)
 {
     if (context.InputPropertyValues.ContainsKey(PrimaryProperty))
     {
         context.AddErrorResult("PrimaryProperty has value.");
     }
     else
     {
         context.AddErrorResult("PrimaryProperty does not exist.");
     }
 }
示例#5
0
 protected override void Execute(Rules.IRuleContext context)
 {
     context.AddInformationResult("Always info");
 }
示例#6
0
 protected override void Execute(Rules.IRuleContext context)
 {
     context.AddErrorResult("Always error");
 }
示例#7
0
 protected override void Execute(Rules.IRuleContext context)
 {
     context.AddWarningResult("Always warns");
 }
示例#8
0
 protected override void Execute(Rules.IRuleContext context)
 {
     throw new InvalidOperationException();
 }
示例#9
0
 protected override void Execute(Rules.IRuleContext context)
 {
     base.Execute(context);
 }
示例#10
0
            protected override void Execute(Rules.IRuleContext context)
            {
#pragma warning disable CS0436 // Type conflicts with imported type
                ((LocationBusinessBase)context.Target).Rule = Csla.ApplicationContext.LogicalExecutionLocation.ToString();
#pragma warning restore CS0436 // Type conflicts with imported type
            }
示例#11
0
 protected override void Execute(Rules.IRuleContext context)
 {
     context.AddErrorResult("Bad rule");
 }
示例#12
0
 protected override void Execute(Rules.IRuleContext context)
 {
     ((LocationBusinessBase)context.Target).Rule = Csla.ApplicationContext.LogicalExecutionLocation.ToString();
 }