Exemplo n.º 1
0
        public override Func <IUser, bool> VisitAttr_pr(BoolExprParser.Attr_prContext context)
        {
            var(attrType, attrName) = GetAttributeInfo(context.children.First());

            return(user =>
                   attrType == "profile"
                    ? !string.IsNullOrEmpty(user.Profile[attrName]?.ToString())
                    : !string.IsNullOrEmpty(user.GetNonProfileAttribute(attrName)));
        }
 /// <summary>
 /// Visit a parse tree produced by <see cref="BoolExprParser.attr_pr"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitAttr_pr([NotNull] BoolExprParser.Attr_prContext context)
 {
     return(VisitChildren(context));
 }