query.MatchUser("u").MatchPost("p").WrittenBy("p", "u")...
I use partially built queries as building blocks:
ICypherFluentQuery FindUser(string email)
{
return graphClient
.Match(“(User:user)”)
.Where((User user) => user.EmailAddress == email);
}
Later on:
Void DeleteUser(string email)
{
FindUser(email)
.Delete(“user”)
.ExecuteWithoutResults();
}
You can also augment existing queries:
ICypherFluentQuery NotSoftDeleted(this ICypherFluentQuery query, string identity)
{
return query. Some clause here;
}
Use it as:
FindUser(email).NotSoftDeleted(“user”). …
There’s an implicit contract here around passing identities around, but I haven’t found that to be unwieldy.
An F# type provider would be probably the nicest solution in the long run…
--
Tatham
--
You received this message because you are subscribed to the Google Groups "Neo4jClient" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
neo4jclient...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.