I'd like to return an IAsyncEnumerable from a method using CypherFluentQuery, is that possible?
That's how far I am with this:
var cypherFluentQuery = _client.Cypher
...CypherQuery Magic here...
.Return(() => new {
...
});
await using var session = _driver.AsyncSession();
IResultCursor? cursor = await session.Run(cypherFluentQuery.Query, _client);
while (await cursor.FetchAsync())
{
IRecord record = cursor.Current;
// Now how to parse IRecord to T (my class, let's stay Student class)?
yield return (Student) record;
}
But I'm stuck deserializing the record from session.Run to my class. StatementResultHelper might be helpful for that, but it's internal. Is there any other way to reach through neo4jclient to get IResultCursor or something different to be able to return as IAsyncEnumerable
Hi,
I'd like to return an IAsyncEnumerable from a method using CypherFluentQuery, is that possible?
That's how far I am with this:
But I'm stuck deserializing the record from
session.Run
to my class.StatementResultHelper
might be helpful for that, but it'sinternal
. Is there any other way to reach through neo4jclient to getIResultCursor
or something different to be able to return asIAsyncEnumerable
Thanks for any help :)