Good, good news / bad news - although in practice, good is tempered badly: (
Ok first:
You can return after CreateUnique, something like:
.CreateUnique("s-[:Knows {knowsData}]-t") .WithParam("knowsData", details) .Returns<???>( "s,t" ) .Results;
Bad news:
The bad news is that you probably can't do this in F #. Neo4jClient requires that you use either object initializers or anonymous data types so that you can try something like:
type FollowingResults = { Follower : Person; Followed : Person;} let createExpression quotationExpression = LeafExpressionConverter.QuotationToLambdaExpression quotationExpression let pAfollowers = client.Cypher .Match("n<-[:follows]-e") .Where(fun n -> n.Twitter = "tA") .Return(createExpression <@ Func<ICypherResultItem, ICypherResultItem, FollowingResults>(fun (e : Cypher.ICypherResultItem) (n : Cypher.ICypherResultItem) -> {Follower = e.As<Person>(); Followed = n.As<Person>()}) @>) .Results .Select(fun x -> x) for follower in pAfollowers do printfn "%s followed %s" follower.Follower.Name follower.Followed.Name
There will be no problem for the F # compiler. However, Neo4jClient throws an Argument exception with the following message:
The expression must be constructed as an object initializer (for example: n => new MyResultType {Foo = n.Bar}), an anonymous type initializer (for example: n => new {Foo = n.Bar}), a method call (for example: n = > n.Count ()) or member access element (for example: n => n.As (). Bar). You cannot provide blocks of code (for example: n => {var a = n + 1; return a;}) or use constructors with arguments (for example: n => new Foo (n)).
The problem is that F # does not have object initializers or anonymous types, you can argue with F # materials for ages and will not go anywhere, since C # does not recognize F # initialization.
source share