I am using VS 2013 and the Neo4j client in an MVC application and can't get past building the query.
In the following code, I can connect to my server but on the var newUser
line I get an error over the new User
statement saying it's a property but used like a type, that can bee seen in this screen shot:
var client = new GraphClient(new System.Uri("http://localhost:7474/db/data"));
client.Connect();
var newUser = new User { Id = 456, Name = "Jim" };
client.Cypher
.Merge("(user:User { Id: {id} })")
.OnCreate("user")
.Set("user = {newUser}")
.WithParams(new
{
id = newUser.Id,
newUser
})
.ExecuteWithoutResults();
I think I need to add or remove a reference but I a not sure what it is.
If you read the error, you'll see User
is a property of Controller
, so it's not recognized as a type.
You'll need to prefix the namespace, like new Neo4j.User()
or whatever its documentation states it uses.