【发布时间】:2016-02-05 15:06:28
【问题描述】:
我已经建立了我的 neo4j 连接,但没有工作,而是抛出了错误:
无法访问 Newtonsoft.Json.Linq.JValue 上的子值。
这是 Neo4j ninject 模块文件:
public class Neo4jModule : NinjectModule
{
/// <summary>Loads the module into the kernel.</summary>
public override void Load()
{
Bind<IGraphClient>().ToMethod(InitNeo4JClient).InSingletonScope();
}
private static IGraphClient InitNeo4JClient(IContext context)
{
var neo4JUri = new Uri("http://www.example.com");
var graphClient = new GraphClient(neo4JUri, "username", "password");
graphClient.Connect();
return graphClient;
}
}
这是我的 Ninject.Web.Common 文件的 RegisterServices 方法:
private static void RegisterServices(IKernel kernel)
{
kernel.Load<Neo4jModule>();
}
我不明白为什么会收到此错误。此异常在以下位置捕获:
graphClient.Connect();
我还调试了我的应用程序,并意识到 graphclient 对象在创建时带有许多错误。谁能帮帮我?
【问题讨论】:
标签: c# json asp.net-mvc linq neo4jclient