如何在C#中创建嵌入式Neo4j数据库 [英] How to create an embedded Neo4j database in c#

查看:308
本文介绍了如何在C#中创建嵌入式Neo4j数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#中创建嵌入式Neo4j数据库?我想在此嵌入式数据库上执行查询以进行测试,然后将其丢弃.目前,我正在使用neo4jclient对在我的系统(本地主机)上运行的数据库执行查询,但希望在嵌入式数据库上执行此操作.我该怎么办?

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?

此功能在Java中的存在方式如下:

This feature is present in Java in the following way:

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

在c#中沿着这些思路寻找东西.

Looking for something along these lines in c#.

推荐答案

这是不可能的.

Neo4j是Java应用程序,您需要JVM才能运行它.

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

您可以尝试的是 IKVM.NET 在.NET VM中运行Neo4j并调用C#代码中的那些方法.

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

您提到要嵌入db进行集成测试.我建议在测试运行中启动Neo4j的新实例.仅用于测试目的.

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.

这篇关于如何在C#中创建嵌入式Neo4j数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆