Exemplo n.º 1
0
        // Queryable's "single value" standard query operators call this method.
        public TResult Execute <TResult>(Expression expression)
        {
            var  type         = typeof(TResult);
            bool IsEnumerable = (type.Name == "IEnumerable`1");

            Type elementType = IsEnumerable ? type.GetGenericArguments()[0] : type;
            var  nodes       = Neo4jQueryContext.Execute(expression, elementType);

            if (IsEnumerable)
            {
                return((TResult)nodes);
            }
            else
            {
                return(((IEnumerable <TResult>)nodes).FirstOrDefault());
            }
        }
Exemplo n.º 2
0
        public object Execute(Expression expression)
        {
            Type elementType = TypeSystem.GetElementType(expression.Type);

            return(Neo4jQueryContext.Execute(expression, elementType));
        }