when delete node in node4jclient use neo4jclient
1. Create
Guid nodeGuid = Guid.NewGuid();
System.DateTime dateTime = System.DateTime.Now;
string timeStamp = String.Format("{0:dd MMMM yyyy HH:mm:ss}", dateTime);
var createNode =//= this.clientConnection.Create(
new clsPlaceEntity()
{
GUID = nodeGuid.ToString(),
PlaceName = name,
PlaceAddpress =addpress ,
PlaceDescription = desc,
PlaceNumOfView = view,
TimeStamp = timeStamp
};
clientConnection.Cypher
.Create("(place:place {place})")
.WithParam("place", createNode)
.ExecuteWithoutResults();
2. Delete node, it not deleted?
public void DeleteUser(long userId)
{
Connect();
FindUserById(userId)
.Delete("place")
.ExecuteWithoutResults();
}
public ICypherFluentQuery FindUserById(long userId)
{
return clientConnection.Cypher
.Match("(place:place)")
.Where((clsPlaceEntity place) => place.GUID == "e4461dba-c4aa-4beb-8c74-0730aaebc6c3");
// Nothing has been executed here: we've just built a query object
}
3. problem???
Object reference not set to an instance of an object.
at Neo4jClient.Cypher.CypherWhereExpressionVisitor.VisitParameterMember(MemberExpression node) in D:\temp\081c198\Neo4jClient\Cypher\CypherWhereExpressionVisitor.cs:line 238
at Neo4jClient.Cypher.CypherWhereExpressionVisitor.VisitMember(MemberExpression node) in D:\temp\081c198\Neo4jClient\Cypher\CypherWhereExpressionVisitor.cs:line 184
at System.Linq.Expressions.MemberExpression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at Neo4jClient.Cypher.CypherWhereExpressionVisitor.VisitBinary(BinaryExpression node) in D:\temp\081c198\Neo4jClient\Cypher\CypherWhereExpressionVisitor.cs:line 67
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at System.Linq.Expressions.ExpressionVisitor.VisitLambda[T](Expression`1 node)
at System.Linq.Expressions.Expression`1.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at Neo4jClient.Cypher.CypherWhereExpressionBuilder.BuildText(LambdaExpression expression, Func`2 createParameterCallback, CypherCapabilities capabilities, Boolean camelCaseProperties) in D:\temp\081c198\Neo4jClient\Cypher\CypherWhereExpressionBuilder.cs:line 21
at Neo4jClient.Cypher.CypherFluentQuery.<>c__DisplayClass59_0.<Where>b__0(QueryWriter w) in D:\temp\081c198\Neo4jClient\Cypher\CypherFluentQuery`Where.cs:line 11
at Neo4jClient.Cypher.CypherFluentQuery.Mutate(Action`1 callback) in D:\temp\081c198\Neo4jClient\Cypher\CypherFluentQuery.cs:line 57
at Neo4jClient.Cypher.CypherFluentQuery.Where(LambdaExpression expression) in D:\temp\081c198\Neo4jClient\Cypher\CypherFluentQuery`Where.cs:line 10
at Neo4jClient.Cypher.CypherFluentQuery.Where[T1](Expression`1 expression) in D:\temp\081c198\Neo4jClient\Cypher\CypherFluentQuery`Where.cs:line 34
at ConsoleApplication1.clsPlaceImp.FindUserById(Int64 userId) in d:\2016\ConsoleApplication1\ConsoleApplication1\clsPlaceImp.cs:line 102
at ConsoleApplication1.clsPlaceImp.DeleteUser(Int64 userId) in d:\2016\ConsoleApplication1\ConsoleApplication1\clsPlaceImp.cs:line 96
at ConsoleApplication1.Program.Main(String[] args) in d:\2016\ConsoleApplication1\ConsoleApplication1\Program.cs:line 22