This is first time I try to use Neo4jClient and have no experiences. I expected my program can print out Name of people with specific relationship has assigned in Neo4j. I've got very simple code like:
using Neo4jClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Neo4J.NET_Labs
{
class Program
{
static void Main(string[] args)
{
var client = new GraphClient(new Uri("http://localhost:7474/db/data"));
client.Connect();
var query = client
.Cypher
.Match("(n)-[:LOVE]-(lover)")
.Return(lover => lover.As<Person>())
;
int count = 0;
foreach (var result in query.Results)
{
count++;
Console.WriteLine("People {0} count {1}", result.name, count);
}
//Stop to show result
Console.ReadLine();
}
}
public class Person
{
public string name;
}
}
Result of snip:
People count 1
People count 2
Could someone pls tell me how to get properties form query.Result.
public string name {get;set;}
I believe Json.NET needs properties, not members to work... - Charlotte Skardon