/// <inheritdoc /> protected override Condition HandleListOperation( Neo4JFilterVisitorContext context, IFilterField field, Neo4JFilterScope scope, string path) => field.Type is IComparableOperationFilterInputType ? CreateArrayAllScalar(scope, path) : CreateArrayAll(scope, path);
/// <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); }
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); }
/// <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);
/// <inheritdoc /> protected override Condition HandleListOperation( Neo4JFilterVisitorContext context, IFilterField field, Neo4JFilterScope scope, string path) => new CompoundCondition(Operator.And);
public static string GetPath(this Neo4JFilterScope scope) => string.Join(".", scope.Path.Reverse());
private static Condition CreateArrayAllScalar(Neo4JFilterScope scope, string path) => new CompoundCondition(Operator.And);