我怎么能在一个共享的主机环境中运行RavenDB? [英] How can I run RavenDB in a shared hosting environment?

查看:184
本文介绍了我怎么能在一个共享的主机环境中运行RavenDB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RavenDB 必须在嵌入式​​模式,据我的理解,应该允许它在共享中运行运行的能力托管环境。

RavenDB has the ability to run in 'embedded' mode, which as far as I understand, should allow it to be run in a shared hosting environment.

有没有人有任何想法如何在ASP.NET MVC应用程序的工作,什么做这将是最好的做法?

Does anyone have any idea how it would work in an ASP.NET MVC application, and what the best practice for doing it would be?

是否有托管环境,我需要知道的任何依赖关系?

Are there any dependencies in the hosting environment that I need to be aware of?

推荐答案

我有RavenDB在一个共享的主机环境中, http://www.winhost.com/ 运行,使用ASP.NET MVC 3 RavenDB 1.0.0.371这是各地公布的2011年7月的某个地方。

I have RavenDB running in a shared hosting environment, http://www.winhost.com/, using ASP.NET MVC 3 and RavenDB 1.0.0.371 which was released somewhere around July 2011.

我的code:

public static class Store
{
    private static IDocumentStore store = createStore();

    private static EmbeddableDocumentStore createStore()
    {
        var returnStore = new EmbeddableDocumentStore();
        returnStore.DataDirectory = @"./PersistedData";
        returnStore.Initialize();
        return returnStore;
    }

    public static xxx Read(string key)
    {
        using (var session = store.OpenSession())
        {

            var anEntity = session.Query<xxx>().
                Where(item => item.key == key).Single();
            return anEntity;
        }
    }

    public static void Write(xxx)
    {
        using (var session = store.OpenSession())
        {
            session.Store(xxx);
            session.SaveChanges();
        }
    }
}

到目前为止,唯一的缺点是我没有得到RavenDB管理工作室。

The only downside so far is I don't get the RavenDB management studio.

这篇关于我怎么能在一个共享的主机环境中运行RavenDB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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