Reputation: 55
My objective is to return two properties from two related nodes.
I want to return DataSpaceName from DataSpace and EntityName from Entity from the two nodes matched by the DataSpaceName/DataSpace property.
public class DataSpace
{
public string DataSpaceName { get; set;}
public string DataSpaceDescription { get; set;}
public string ConnectionString { get; set;}
}
public class Entity
{
public string DataConnector { get; set;}
public string EntityName { get; set;}
public string EntityType { get; set;}
public string DataSpace{get; set;}
}
var query =
client
.Cypher
.Match("(DataSpace:DataSpace), (Entity:Entity)")
.Where("Entity.DataSpace = DataSpace.DataSpaceName")
.Return ((DataSpace,Entity) => new {
DSName = Return.As<string>("DataSpace.DataSpaceName"),
EName=Return.As<string>("Entity.EntityName")
});
This throws an error :
Compiler Error Message: CS0103: The name 'Return' does not exist in the current context
Instead of Return, if I use the Node (say DataSpace.As() ) I get the entire DataSpace Node.
Can somebody throw light on the mistake Im making in this.
Upvotes: 1
Views: 113
Reputation: 4290
It looks like you've only imported the Neo4jClient
namespace. You need to import Neo4jClient.Cypher
as well if you want to use the Return
class.
ReSharper would have also suggested this for you.
Upvotes: 2