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.