实现多租户 ASP.NET MVC 应用程序的最快方法
我想我不明白这一切的意义。 我的目的是创建一个多租户 ASP.NET MVC 应用程序。
我在此处看到了一篇关于如何执行此操作的精彩帖子 ,但 Nhibernate 不是一个选择。
我想了解的一件事是: MVC(以及其他所有内容)应该有助于创建多租户 Web 应用程序吗?
我看到了一些与我的问题类似的评论,但它们通常似乎没有达到我想要表达的同一点:
- 一个数据库
- 一个架构
- 没有 Nhibernate
如果有人知道一个关于如何做到这一点的简单解释完成了,我很感激。
这个页面上的内容是我所知道的关于这个主题的全部内容,我所知道的希望能够理解的是 MVC(如果有的话)如何帮助完成它,以及它是否使事情变得更简单。
非常感谢,
里克
I think I am not getting the meaning of any of this.
My purpose is to create a multi tenant ASP.NET MVC Application.
I saw a great post on how to do this here
, but Nhibernate isn't an option.
One of the things I want to understand is:
Is MVC (along with everything else) supposed to help in creating multi tenancy web apps?
I have seen several comments which are similar to my question, but they often don't appear to hit the same point I am trying to get at:
- One DB
- One Schema
- No Nhibernate
If anyone knows of a simple explanation as to how this can be done, I appreciate it.
the contents on this page are all I know on the subject, what I wish to be able to understand is how MVC (if at all) helps in getting it done and if it makes it simpler or not.
Many thanks,
Ric
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我能找到的最能回答我的问题的是阅读 Mike Hadlow 的博客
内容详细,但切题,我下载了SutekiShop 应用程序。
我还没达到AHA! 虽然还没有到,但似乎已经很接近了。
我相信他实现多租户的方式是使用角色 ID,我想现在我只需要继续阅读和调整。
他的最新帖子 (afaik)主题似乎解决了 WCF 使用的问题。
The closest thing to answer my question here, that I can find myself is the read on Mike Hadlow's blog
Its detailed, but to the point, and I downloaded the SutekiShop app.
I haven't yet reached the AHA! Moment yet, but it seems close.
I believe the way he has implemented the multi tenancy was with the role id, I guess now I just have to keep reading and tweaking.
His latest post (afaik) on the subject seems to address the issue with WCF use.
我对多租户应用程序的 MVC 的看法是:
你的租户
这在 Webforms 中绝非易事。 在 MVC 中很容易实现这样的东西:每个租户都有一个默认视图,但如果租户需要特殊视图,则采用特殊视图。 您必须稍微扩展 Viewengine。
StructureMap 或其他内容,您可以交换 ServiceLayer 的部分内容
我每个租户有一个数据库,所以我不会提供帮助
在数据库部分。
The thinks I like about MVC for multitenant applications are:
your tenant
That was never easy in Webforms. Its easy to implement something in MVC like: There is a default View for every tenant, but if a tenant needs a special View, then the special View is taken. You will have to extend the Viewengine a little bit.
By using StructureMap or others you can swap parts of your ServiceLayer
I have one DB per tenant so I will not be of help
at the DB - part.