protected AnnotatedQuery(ICypherFluentQuery query, AnnotatedQuery previous) : base(query) { if (VbCompareReplacerType == null) { var neo4jClientAssembly = typeof(ICypherFluentQuery).GetTypeInfo().Assembly; VbCompareReplacerType = neo4jClientAssembly.GetType("Neo4jClient.Cypher.VbCompareReplacer"); } if (previous == null) { QueryContext = CypherUtilities.GetQueryContext(query); CamelCaseProperties = (bool)query.GetType().GetField("CamelCaseProperties", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).GetValue(query); FunctionVisitor = new FunctionExpressionVisitor(QueryContext); } else { QueryContext = previous.QueryContext; QueryContext.CurrentQueryWriter = QueryWriterGetter(query); QueryContext.CurrentBuildStrategy = QueryContext.BuildStrategyGetter(query); CamelCaseProperties = previous.CamelCaseProperties; var funcsVisitor = previous.FunctionVisitor; funcsVisitor.QueryContext = QueryContext; FunctionVisitor = funcsVisitor; } var context = QueryContext?.AnnotationsContext ?? previous?.AnnotationsContext; if (context != null) { AnnotationsContext = context; } }