Exemple #1
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>
            }
        }
Exemple #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.codehaus.jackson.JsonNode serialize(java.io.ByteArrayOutputStream out, org.codehaus.jackson.JsonGenerator json, ResultDataContentWriter resultDataContentWriter) throws java.io.IOException, org.neo4j.server.rest.domain.JsonParseException
        private JsonNode Serialize(MemoryStream @out, JsonGenerator json, ResultDataContentWriter resultDataContentWriter)
        {
            json.writeStartObject();
            // RETURN {one:{two:[true, {three: 42}]}}
            resultDataContentWriter.Write(json, asList("the column"), new MapRow(map("the column", map("one", map("two", asList(true, map("three", 42)))))), null);
            json.writeEndObject();
            json.flush();
            json.close();

            string jsonAsString = @out.ToString();

            return(jsonNode(jsonAsString).get("rest"));
        }