public string Describe(Result result)
 {
     builder.Clear();
     result = result.Optimize();
     result.Accept(this);
     return(builder.ToString());
 }
예제 #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void writeRows(final Iterable<String> columns, org.neo4j.graphdb.Result data, final ResultDataContentWriter writer) throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
        private void WriteRows(IEnumerable <string> columns, Result data, ResultDataContentWriter writer)
        {
            @out.writeArrayFieldStart("data");
            try
            {
                data.Accept(row =>
                {
                    @out.writeStartObject();
                    try
                    {
                        using (TransactionStateChecker txStateChecker = TransactionStateChecker.Create(_container))
                        {
                            writer.Write(@out, columns, row, txStateChecker);
                        }
                    }
                    finally
                    {
                        @out.writeEndObject();
                    }
                    return(true);
                });
            }
            finally
            {
                @out.writeEndArray();                         // </data>
            }
        }
        public string Describe(Result result)
        {
            result = result.Optimize();

            builder.Clear();
            result.Accept(this);
            return Message;
        }
예제 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldBePossibleToConsumeCompiledExecutionResultsWithVisitor()
        public virtual void ShouldBePossibleToConsumeCompiledExecutionResultsWithVisitor()
        {
            // Given
            CreateNode();
            CreateNode();

            // When
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.List<org.neo4j.graphdb.Result_ResultRow> listResult = new java.util.ArrayList<>();
            IList <Org.Neo4j.Graphdb.Result_ResultRow> listResult = new List <Org.Neo4j.Graphdb.Result_ResultRow>();

            using (Result result = Db.execute("CYPHER runtime=compiled MATCH (n) RETURN n"))
            {
                result.Accept(row =>
                {
                    listResult.Add(row);
                    return(true);
                });
            }

            // Then
            assertThat(listResult, hasSize(2));
        }
 public static IActionResult ToActionResult <TValue>(this Result <TValue> result)
 => result.Accept(new ResultMappingVisitor <TValue, TValue>()).Result;
 public static ActionResult <TModel> ToActionResult <TValue, TModel>(this Result <TValue> result, Func <TValue, TModel> valueMapper)
 => result.Accept(new ResultMappingVisitor <TValue, TModel>(valueMapper));