本文整理汇总了C#中RuleContext.AddSuccessResult方法的典型用法代码示例。如果您正苦于以下问题:C# RuleContext.AddSuccessResult方法的具体用法?C# RuleContext.AddSuccessResult怎么用?C# RuleContext.AddSuccessResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RuleContext
的用法示例。
在下文中一共展示了RuleContext.AddSuccessResult方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
/// <summary>
/// The execute.
/// </summary>
/// <param name="context">
/// The context.
/// </param>
protected override void Execute(RuleContext context)
{
var target = (Csla.Core.ITrackStatus)context.Target;
if (target.IsNew)
{
context.AddSuccessResult(true);
}
}
示例2: Execute
/// <summary>
/// Execut rule.
/// Short circuit if field is not included in InputPropertyValues.
/// </summary>
/// <param name="context">Rule context object.</param>
protected override void Execute(RuleContext context)
{
if (!context.InputPropertyValues.ContainsKey(PrimaryProperty))
{
context.AddSuccessResult(true);
}
}
示例3: Execute
/// <summary>
/// The execute.
/// </summary>
/// <param name="context">
/// The context.
/// </param>
protected override void Execute(RuleContext context)
{
var target = (Csla.Core.BusinessBase)context.Target;
// Short circuit rule processing for this property if user is not allowed to edit field.
if (!target.CanWriteProperty(PrimaryProperty))
{
context.AddSuccessResult(true);
}
}
示例4: Execute
protected override void Execute(RuleContext context)
{
// TODO: Asyncronous rules
// If rule is async make sure that ALL excution paths call context.Complete
var ctx = context.Target as Opcion;
if (ctx != null)
{
if (ctx.ListaPlantillas.Count == 0)
{
context.AddErrorResult("Debe asignar las Plantillas de Permisos en esta Opción");
}
else
context.AddSuccessResult(true);
}
// TODO: Add actual rule code here.
//if (broken condition)
//{
// context.AddErrorResult("Broken rule message");
//}
}