Beispiel #1
0
        public IBlankQuery Search(Parameter searchWords, SearchOperator searchOperator, Node searchNodeType, out FloatResult scoreAlias, params FieldResult[] searchFields)
        {
            AliasResult scoreResult = new AliasResult();

            scoreAlias = new FloatResult(scoreResult, null, null, typeof(double));
            Aliases    = new[] { scoreResult };

            return(Search(searchWords, searchOperator, searchNodeType, searchFields));
        }
Beispiel #2
0
        public PathNode Path(out PathResult alias)
        {
            AliasResult aliasResult = new AliasResult()
            {
                Node = this,
            };

            alias = new PathResult(aliasResult, null);
            return(new PathNode(this, aliasResult));
        }
        public AsResult As(string aliasName, out BooleanJaggedListResult alias)
        {
            AliasResult aliasResult = new AliasResult(this, null)
            {
                AliasName = aliasName
            };

            alias = new BooleanJaggedListResult(aliasResult, null, null, null, typeof(bool[]));
            return(this.As(aliasName));
        }
        public AsResult As(string aliasName, out MiscJaggedListResult alias)
        {
            AliasResult aliasResult = new AliasResult(this, null)
            {
                AliasName = aliasName
            };

            alias = new MiscJaggedListResult(aliasResult, null, null, null, typeof(object[]));
            return(this.As(aliasName));
        }
        public AsResult As(string aliasName, out NumericJaggedListResult alias)
        {
            AliasResult aliasResult = new AliasResult(this, null)
            {
                AliasName = aliasName
            };

            alias = new NumericJaggedListResult(aliasResult, null, null, null, typeof(long[]));
            return(this.As(aliasName));
        }
Beispiel #6
0
        public AsResult As(string aliasName, out NumericResult alias)
        {
            AliasResult aliasResult = new AliasResult()
            {
                AliasName = aliasName
            };

            alias = new NumericResult(aliasResult, null, null, null, typeof(long));
            return(this.As(aliasName));
        }
Beispiel #7
0
        public AsResult As(string aliasName, out MiscResult alias)
        {
            AliasResult aliasResult = new AliasResult()
            {
                AliasName = aliasName
            };

            alias = new MiscResult(aliasResult, null, null, null, typeof(object));
            return(this.As(aliasName));
        }
        public AsResult As(string aliasName, out StringListResult alias)
        {
            AliasResult aliasResult = new AliasResult(this, null)
            {
                AliasName = aliasName
            };

            alias = new StringListResult(aliasResult, null, null, null, typeof(string));
            return(this.As(aliasName));
        }
Beispiel #9
0
        public AsResult As(string aliasName, out BooleanResult alias)
        {
            AliasResult aliasResult = new AliasResult()
            {
                AliasName = aliasName
            };

            alias = new BooleanResult(aliasResult, null, null, null, typeof(bool));
            return(this.As(aliasName));
        }
Beispiel #10
0
        //public QueryCondition All(Func<TResult, QueryCondition> condition)
        //{
        //    TResult alias = NewResult("item", new object[0]);
        //    QueryCondition test = condition.Invoke(alias);

        //    return new QueryCondition(new BooleanResult("all(item IN {base} WHERE {0})", new object[] { test }));
        //}
        //public QueryCondition Any(Func<TResult, QueryCondition> condition)
        //{
        //    TResult alias = NewResult("item", new object[0]);
        //    QueryCondition test = condition.Invoke(itemField);

        //    return new QueryCondition(new BooleanResult(itemField, "any(item IN {base} WHERE {0})", new object[] { test }));
        //}
        //public QueryCondition None(Func<TResult, QueryCondition> condition)
        //{
        //    TResult alias = NewResult("item", new object[0]);
        //    QueryCondition test = condition.Invoke(itemField);

        //    return new QueryCondition(new BooleanResult(this, "none(item IN {base} WHERE {0})", new object[] { test }));
        //}
        //public QueryCondition Single(Func<TResult, QueryCondition> condition)
        //{
        //    TResult alias = NewResult("item", new object[0]);
        //    QueryCondition test = condition.Invoke(itemField);

        //    return new QueryCondition(new BooleanResult(this, "single(item IN {base} WHERE {0})", new object[] { test }));
        //}

        public AsResult As(string aliasName, out TList alias)
        {
            AliasResult aliasResult = new AliasResult()
            {
                AliasName = aliasName
            };

            alias = ResultHelper.Of <TList>().NewAliasResult(aliasResult, null, null, null);
            return(this.As(aliasName));
        }
        public AsResult As(string aliasName, out RelationFieldResult alias)
        {
            AliasResult aliasResult = new AliasResult(this, null)
            {
                AliasName = aliasName
            };

            alias = new RelationFieldResult(aliasResult, null);
            return(this.As(aliasName));
        }
        public AsResult As(string aliasName, out FloatJaggedListResult alias)
        {
            AliasResult aliasResult = new AliasResult(this, null)
            {
                AliasName = aliasName
            };

            alias = new FloatJaggedListResult(aliasResult, null, null, null, typeof(double[]));
            return(this.As(aliasName));
        }
        public AsResult As(string aliasName, out DateTimeJaggedListResult alias)
        {
            AliasResult aliasResult = new AliasResult(this, null)
            {
                AliasName = aliasName
            };

            alias = new DateTimeJaggedListResult(aliasResult, null, null, null, typeof(DateTime[]));
            return(this.As(aliasName));
        }
Beispiel #14
0
        public PathNode Path(out PathResult alias, string name)
        {
            AliasResult aliasResult = new AliasResult()
            {
                AliasName = name,
                Node      = this,
            };

            alias = new PathResult(aliasResult, null);
            return(new PathNode(this, aliasResult));;
        }
        public AsResult As(string aliasName, out FloatResult alias)
        {
            AliasResult aliasResult = new AliasResult(this, null)
            {
                AliasName = aliasName
            };

            alias = new FloatResult(aliasResult, null, null, null, this.GetResultType() ?? typeof(double));
            //alias = new FloatResult(aliasResult, null, null, null, typeof(double));
            return(this.As(aliasName));
        }
Beispiel #16
0
        public IMatchQuery As(string aliasName, out MiscResult alias)
        {
            this.WithResults = new[] { Fields.First().As(aliasName) };

            AliasResult aliasResult = new AliasResult()
            {
                AliasName = aliasName
            };

            alias = new MiscResult(aliasResult, null, null, null, typeof(object));

            return(New);
        }
Beispiel #17
0
        public static StringResult NodeType(AliasResult alias)
        {
            if (alias is null)
            {
                throw new ArgumentNullException(nameof(alias));
            }

            if (alias.Node is null)
            {
                throw new ArgumentException("The alias is not bound to an Entity.");
            }

            Parameter concreteLabels = Parameter.Constant(alias.Node.Entity.GetConcreteClasses().Select(y => y.Label.Name).Distinct().ToList());

            return(new StringResult(alias, t => "HEAD(apoc.coll.intersection(LABELS({base}), {0}))", new object[] { concreteLabels }, typeof(string)));
        }
Beispiel #18
0
 protected ListResult(AliasResult parent, Func <QueryTranslator, string?>?function, object[]?arguments = null, Type?type = null) : base(parent, function, arguments, type)
 {
 }
 public RelationFieldResult(AliasResult alias, string?fieldName) : base(alias, fieldName, null, null, typeof(DateTime))
 {
 }
 internal PathNode(Node node, AliasResult alias)
 {
     Node        = node ?? throw new ArgumentNullException(nameof(node));
     NodeAlias   = alias ?? throw new ArgumentNullException(nameof(alias));
     IsReference = node.IsReference;
 }
 protected internal PathResult(AliasResult alias, Func <QueryTranslator, string?>?function, object[]?arguments  = null, Type?type = null)
 {
     Alias = alias ?? throw new ArgumentNullException(nameof(alias));
     Node  = alias.Node ?? throw new ArgumentNullException($"{nameof(alias)}.{nameof(alias.Node)}");;
     OverridenReturnType = type;
 }
Beispiel #22
0
 protected FieldResult(AliasResult alias, Func <QueryTranslator, string?>?function, object[]?arguments, Type?type) : this(alias, null, null, null, null, function, arguments, type)
 {
 }
Beispiel #23
0
 protected FieldResult(AliasResult alias, string?fieldName, Entity?entity, Property?property, Type?overridenReturnType = null) : this(alias, fieldName, entity, property, null, null, null, null)
 {
     OverridenReturnType = overridenReturnType;
 }
 public StringListResult(AliasResult alias, string?fieldName, Entity?entity, Property?property, Type?type = null) : base(alias, fieldName, entity, property, type)
 {
 }
 public StringListResult(AliasResult alias, Func <QueryTranslator, string?>?function, object[]?arguments = null, Type?type = null) : base(alias, function, arguments, type)
 {
 }
Beispiel #26
0
 public StringResult(AliasResult alias, string?fieldName, Entity?entity, Property?property, Type?overridenReturnType = null) : base(alias, fieldName, entity, property, overridenReturnType)
 {
 }