使用 RavenDB 作为 Orchard CMS 模块的数据库 [英] Use RavenDB as the database for an Orchard CMS module

查看:47
本文介绍了使用 RavenDB 作为 Orchard CMS 模块的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用 Orchard CMS.创建一个使用 RavenDB 作为数据库的 Orchard 模块有多难?对 SQL 和 NHibernate 的严重依赖是否深深植根于 Orchard 中?

I'm just getting underway with Orchard CMS. How difficult would it be to create an Orchard module that uses RavenDB as its database? Is a hard dependency on SQL and NHibernate baked deeply into Orchard?

推荐答案

Orchard 的所有核心功能都基于 NHibernate,因此很难将整个 Orchard 数据库移动到另一个 NHibernate 不支持的 DBMS.然而,Orchard 具有很强的可扩展性,可以很容易地从您自己的模块访问各种自定义数据源.例如,我目前在一个项目中工作,我们将数据存储在图形数据库 (neo4j) 中,并使用 WCF 服务在 Orchard 中访问它们.

All of Orchard's core features are based on NHibernate so it would be difficult to move the entire Orchard database to another DBMS not supported by NHibernate. However, Orchard is very extensible and it is quite easy to access all kinds of custom data sources from your own modules. For example, I am currently working in a project where we store our data in a graph database (neo4j) and access them in Orchard using a WCF service.

这取决于您需要访问的数据类型,但您可能需要创建一个自定义内容部分来动态加载数据,而不是通过 NHibernate 使用底层 SQL 数据库.您可以通过继承非通用 ContentPart 类(通用类使用使用 NHibernate 存储的记录)并使用 ContentHandler 从自定义数据源填充数据来实现此目的.

It depends on what kind of data you need to access, but you will probably need to create a custom content part which dynamically loads data instead of using the underlying SQL database through NHibernate. You can do this by inheriting from the non-generic ContentPart class (the generic one uses a record stored using NHibernate) and using a ContentHandler to populate the data from your custom data source.

这篇关于使用 RavenDB 作为 Orchard CMS 模块的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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