How to create an embedded Neo4j database in c#

爱⌒轻易说出口 提交于 2019-12-02 00:12:31

问题


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:


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.



来源:https://stackoverflow.com/questions/30892776/how-to-create-an-embedded-neo4j-database-in-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!