编程配置多个数据库ActiveRecordFacility [英] Programmatically configure ActiveRecordFacility for multiple databases

查看:226
本文介绍了编程配置多个数据库ActiveRecordFacility的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图构建一个使用插件架构的小型应用程序(ASP.NET MVC)。随着城堡ActiveRecord的集成工具。我希望让每一个插件配置自己的ActiveRecord的行为​​。如数据库连接字符串,代理等。
但是,我无法找到一个方法来设置多个配置,而无需使用web.config文件。我们的想法是使这种编程方式。

I'm trying to build a small application (ASP.NET MVC) that uses the plugin architecture. Along with Castle ActiveRecord Integration Facility. And I wish to let each plugin configure its own ActiveRecord behaviors. Like database connection string, proxy, etc.. However, I couldn't find a way to set multiple configurations without the use of web.config. The idea is to make this programmatically.

我的目标是在本系统中的每个插件,如果它定义了自己的ActiveRecord的设置,主要应用可以旁设立ActiveRecordFacility这些行为。

My goal is for each plugin in this system, if it defines its own ActiveRecord settings, the main application can set up next to ActiveRecordFacility these behaviors.

已经有人做这样的事情?

has someone do something like that?

P.S:不好意思,语法错误......谷歌翻译...; P

P.S.: sorry, bad grammar...google translate...;P

推荐答案

好吧......在Lostechies的例子伟大工程。 (<一href=\"http://www.lostechies.com/blogs/rssvihla/archive/2009/06/03/castle-activerecord-and-registering-classes-at-runtime.aspx\"相对=nofollow>链接文本)

Ok...the example in Lostechies works great. (link text)

毛,谢谢你的提示!

这篇关于编程配置多个数据库ActiveRecordFacility的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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