Example #1
0
        protected override bool IsValid(PropertyValidatorContext context)
        {
            var ret = HostContext.AppHost.EvalScript(context.ToPageResult(Code), context.ParentContext.Request);

            return(DefaultScripts.isTruthy(ret));
        }
Example #2
0
        //public override bool ShouldValidateAsync(ValidationContext context) => true;

        protected override async Task <bool> IsValidAsync(PropertyValidatorContext context, CancellationToken cancellation)
        {
            var ret = await HostContext.AppHost.EvalScriptAsync(context.ToPageResult(Code), context.ParentContext.Request);

            return(DefaultScripts.isTruthy(ret));
        }