/// <inheritdoc />
 protected override Condition HandleListOperation(
     Neo4JFilterVisitorContext context,
     IFilterField field,
     Neo4JFilterScope scope,
     string path) =>
 field.Type is IComparableOperationFilterInputType
         ? CreateArrayAllScalar(scope, path)
         : CreateArrayAll(scope, path);
示例#2
0
        /// <summary>
        /// Combines all definitions of the <paramref name="scope"/> with and
        /// </summary>
        /// <param name="scope">The scope where the definitions should be combined</param>
        /// <returns>A with and combined filter definition of all definitions of the scope</returns>
        protected static Condition CombineOperationsOfScope(Neo4JFilterScope scope)
        {
            Queue <Condition> level = scope.Level.Peek();

            if (level.Count == 1)
            {
                return(level.Peek());
            }

            var conditions = new CompoundCondition(Operator.And);

            foreach (Condition condition in level)
            {
                conditions.And(condition);
            }

            return(conditions);
        }
示例#3
0
        public static bool TryCreateQuery(
            this Neo4JFilterScope scope,
            [NotNullWhen(true)] out CompoundCondition query)
        {
            query = null;

            if (scope.Level.Peek().Count == 0)
            {
                return(false);
            }

            var conditions = new CompoundCondition(Operator.And);

            foreach (Condition condition in scope.Level.Peek().ToArray())
            {
                conditions.And(condition);
            }

            query = conditions;

            return(true);
        }
示例#4
0
 /// <summary>
 /// Maps a operation field to a Neo4J list filter definition.
 /// This method is called when the <see cref="FilterVisitor{TContext,T}"/> enters a
 /// field
 /// </summary>
 /// <param name="context">The context of the visitor</param>
 /// <param name="field">The currently visited filter field</param>
 /// <param name="scope">The current scope of the visitor</param>
 /// <param name="path">The path that leads to this visitor</param>
 /// <returns></returns>
 protected abstract Condition HandleListOperation(
     Neo4JFilterVisitorContext context,
     IFilterField field,
     Neo4JFilterScope scope,
     string path);
示例#5
0
 /// <inheritdoc />
 protected override Condition HandleListOperation(
     Neo4JFilterVisitorContext context,
     IFilterField field,
     Neo4JFilterScope scope,
     string path) =>
 new CompoundCondition(Operator.And);
示例#6
0
 public static string GetPath(this Neo4JFilterScope scope) =>
 string.Join(".", scope.Path.Reverse());
 private static Condition CreateArrayAllScalar(Neo4JFilterScope scope, string path) =>
 new CompoundCondition(Operator.And);