protected override bool IsValid(PropertyValidatorContext context) { var ret = HostContext.AppHost.EvalScript(context.ToPageResult(Code), context.ParentContext.Request); return(DefaultScripts.isTruthy(ret)); }
//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)); }