I have this raw query I wish to convert to the fluent interface.
var assetExistsQuery = new Query(
@"MATCH (tenant:Tenant)-[r]->(user:User {userName: $userName})
WHERE tenant.status = $status AND tenant.userId = $userId
RETURN user,tenant", new
{
userId = params.UserId,
status = params.TenantStatus,
userName = params.UserName,
});
This is what I've got to so far
var result = await CypherQuery
.Match("(tenant:Tenant)-[r]->(user:User)")
.Where((Tenant tenant, User user) => tenant.Status == params.Status && tenant.UserId == params.UserId && user.UserName == params.UserName)
.Return<Tenant>("tenant").ResultsAsync;
but I am getting this error
System.MissingMethodException: 'Method not found: 'System.Threading.Tasks.Task`1<!!0> Neo4j.Driver.IAsyncSession.ReadTransactionAsync(System.Func`2<Neo4j.Driver.IAsyncTransaction,System.Threading.Tasks.Task`1<!!0>>)'.'
my project uses these packages:
<PackageReference Include="Neo4j.Driver.Simple.Signed" Version="5.0.0" />
<PackageReference Include="Neo4jClient.DataAnnotations" Version="2.2.4" />
<PackageReference Include="Neo4jClient.Extension.Attributes.NetStandard" Version="2.0.0" />
<PackageReference Include="Neo4jClient.Extension.NetStandard" Version="2.0.0" />
Do you know what am I doing wrong here?
The
WhereI think is the problem, please try:You might be able to get away with the two
Tenantchecks in the same clause, but I suspect not as you need theANDand that comes from theAndWherebit