如何在c#中连接到RavenHQ

问题描述 投票:3回答:1

我正在尝试连接到ravenHQ而且我得到了

https://database-d0sm.ravenhq.com;Database=DatabaseName;ApiKey=

但是如何在c#中将其添加到商店?

    private static IDocumentStore store = new DocumentStore()
    {
        Urls = new[] { "url" },
        Database = "DatabaseName"
    }.Initialize();

好的,为了做到这一点,我需要在我的.net应用程序中降级Ravendb的版本。 api密钥仅在Ravendb 3.5中受支持。这就是问题所在。

c# .net ravendb
1个回答
5
投票
var store = new DocumentStore
{
    ConnectionStringName = "MyRavenConnectionString"
};

然后在你的web.configapp.config

<connectionStrings>
   <add name="MyRavenConnectionString" connectionString="Url = Url = http://ravendb.mydomain.com;User=user;Password=secret"/>
</connectionStrings>
© www.soinside.com 2019 - 2024. All rights reserved.