src/openCypherParser/AST/CypherVisitor.cs
/// <summary>
/// Helper function to get all direct entity reference from a return body item list ( [some expr] AS [alias] )
/// E.g.  MATCH (p:person) WITH p as q, p.id as Id, this will return just Entity with alias = p and type = person
/// </summary>
/// <param name="exprs"></param>
/// <returns>A dictionary of the reference to the Entity object keyed by its alias (in AS [alias] expr)</returns>
Helper function to get all direct entity reference from a return body item list ( [some expr] AS [alias] )
E.g.  MATCH (p:person) WITH p as q, p.id as Id, this will return just Entity with alias = p and type = person
Helper function to get all direct entity reference from a return body item list ( [ some expr ] AS [ alias ] ) E . g . MATCH ( p : person ) WITH p as q p . id as Id this will return just Entity with alias = p and type = person
private IDictionary<string, Entity> GetDirectlyExposedEntities(IEnumerable<QueryExpressionWithAlias> exprs)
        {
            return exprs
                .Select(expr => new { Alias = expr.Alias, Entity = expr.InnerExpression.TryGetDirectlyExposedEntity() })
                .Where(e => e.Entity != null)
                .ToDictionary(expr => expr.Alias, expr => expr.Entity);
        }
private IDictionary < string , Entity > GetDirectlyExposedEntities ( IEnumerable < QueryExpressionWithAlias > exprs ) { return exprs . Select ( expr => new { Alias = expr . Alias , Entity = expr . InnerExpression . TryGetDirectlyExposedEntity ( ) } ) . Where ( e => e . Entity != null ) . ToDictionary ( expr => expr . Alias , expr => expr . Entity ) ; }
Helper function to get all direct entity reference from a return body item list ( [some expr] AS [alias] )
E.g.
Helper function to get all direct entity reference from a return body item list ( [ some expr ] AS [ alias ] ) E . g .
A dictionary of the reference to the Entity object keyed by its alias (in AS [alias] expr)
A dictionary of the reference to the Entity object keyed by its alias ( in AS [ alias ] expr )
exprs
IEnumerable<QueryExpressionWithAlias>
None