Esempio n. 1
0
        public override HqlTreeNode BuildHql(MethodInfo method, Expression targetObject, ReadOnlyCollection <Expression> arguments, HqlTreeBuilder treeBuilder, IHqlExpressionVisitor visitor)
        {
            var collection = visitor.Visit(method.IsStatic ? arguments[0] : targetObject).AsExpression();
            var index      = visitor.Visit(method.IsStatic ? arguments[1] : arguments[0]).AsExpression();

            return(treeBuilder.Index(collection, index));
        }
Esempio n. 2
0
        public override HqlTreeNode BuildHql(MethodInfo method, Expression targetObject, ReadOnlyCollection <Expression> arguments, HqlTreeBuilder treeBuilder, IHqlExpressionVisitor visitor)
        {
            string memberName;

            if (VisitorUtil.IsDynamicComponentDictionaryGetter(method, targetObject, arguments, visitor.SessionFactory, out memberName))
            {
                return(treeBuilder.Dot(visitor.Visit(targetObject).AsExpression(), treeBuilder.Ident(memberName)));
            }
            return(treeBuilder.Index(visitor.Visit(targetObject).AsExpression(), visitor.Visit(arguments[0]).AsExpression()));
        }