可插入的 ASP.NET MVC 框架查询

发布于 2024-09-24 09:12:59 字数 548 浏览 2 评论 0原文

我正在尝试创建一个可插入的 ASP.NET MVC 框架。我广泛使用了 Prism(用于 silverlight 的 CAB),并且是一个超级粉丝,希望在我的可插拔 ASP.NET MVC 框架中实现以下项目

  1. 该框架将有一个主机来加载 Unity 容器和其他基础设施项目(例如日志记录 。

  2. 插件将是独立的MVC2应用程序。每个应用程序都会实现 IModule 接口,它将在 Unity 中初始化和注册控制器/视图(这可能吗!!!)类型?

  3. 此 IModule 还将注册每个插件的自定义路由并将其添加到主机路由集合。

  4. 当应用程序启动时,将从数据库/外部文件加载插件列表,并且将调用项目的 IModule,这将在 Unity 容器中加载上述项目。

  5. 每当发出任何请求时,控制器都会从 Unity 中加载,并且视图也会被加载(我是否可以在 Unity 中注册一个自定义视图引擎,它将指向物理路径,而不是将资源嵌入到 dll 中)

这可能吗?这个问题可能听起来有点愚蠢......:)

I am trying to create a pluggable ASP.NET MVC framework. I have extensively used Prism (CAB for silverlight) and am a huge fan and wish to implement the following items in my pluggable ASP.NET MVC framework

  1. The framework will have a host to load the unity container and other infrastructure items like logging services and all.

  2. Plugins will be independent MVC2 application. Every application will have IModule interface implemented which will initialize and register Controllers/VIEWS(Is this possible!!!) type in Unity?

  3. This IModule will also register custom routes per plugin and add it to host Routes collection.

  4. When the application will start, the plugins list will be loaded from the database/external file and IModule of the project will be called which will load the above mentioned items in Unity Container.

  5. Whenever any request is made, the controller will be loaded from unity and the Views will be loaded (Is it possible that I register a custom view engine in unity which will point to physical path rather than embedding the resource in the dll)

Is this possible. The question may sound a bit stupid... :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故事灯 2024-10-01 09:12:59

这通常是可能的,尽管需要从头开始进行大量工作。幸运的是,Microsoft 的 Orchard 项目已经完成了您所要求的几乎所有操作,并且您可以下载 MVC 源代码来查看它是如何完成的。请参阅:http://orchard.codeplex.com/

This is generally possible, though a lot of work from scratch. Fortunately Microsoft's Orchard project already does pretty much everything you are asking, and you can download the MVC source code to see how it's done. See: http://orchard.codeplex.com/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文