How to create an embedded Neo4j database in c#

2019-02-25 12:33发布

How do I create an embedded Neo4j database in c#? I want to perform queries on this embedded database for testing and then discard it. Currently i'm using neo4jclient for performing queries on the database running on my system(localhost) but want to do this on an embedded database. How do I go about this?

This feature is present in Java in the following way:

GraphDatabaseFactory graphDbFactory = new GraphDatabaseFactory();
GraphDatabaseService graphDb = graphDbFactory
      .newEmbeddedDatabase("data/dbName");

Looking for something along these lines in c#.

1条回答
别忘想泡老子
2楼-- · 2019-02-25 13:04

It's not possible to do that.

Neo4j is a Java application and you need JVM to run it.

What you can try is IKVM.NET to run Neo4j in the .NET VM and call those methods from C# code.

You mentioned you want to embedded db for integration testings. I suggest to start new instance of Neo4j as part of test run. Only for testing purposes.

查看更多
登录 后发表回答