I'm using the example from https://github.com/Readify/Neo4jClient/wiki/cypher-examples#delete-a-user-and-all-inbound-relationships
graphClient.Cypher
.OptionalMatch("(user:User)<-[r]-()")
.Where((User user) => user.Id == 123)
.Delete("r, user")
.ExecuteWithoutResults();
and change it to fit my needs to this
WebApiConfig.GraphClient.Cypher
.OptionalMatch("(user:User)<-[r]-()")
.Where((User user) => user.userId == userId)
.Delete("r, user")
.ExecuteWithoutResults();
but every time I can still get the user by
User user1 = WebApiConfig.GraphClient.Cypher
.Match("(u:User)")
.Where((User u) => u.userId == userId)
.Return(u => u.As<User>())
.Results
.FirstOrDefault();
what I'm doing wrong?
the Node labels is
User
the properties labels are
LastName, Name, FirstName, UpdatedTime, Email, facebookId, Picture, userId
the define of graph db class
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "ActionApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
);
//Use an IoC container and register as a Singleton
var url = ConfigurationManager.AppSettings["GraphDBUrl"];
var user = ConfigurationManager.AppSettings["GraphDBUser"];
var password = ConfigurationManager.AppSettings["GraphDBPassword"];
var client = new GraphClient(new Uri(url), user, password);
client.Connect();
GraphClient = client;
}
public static IGraphClient GraphClient { get; private set; }
}