获取多租户应用程序的Url值

时间:2016-06-29 10:28:35

标签: c# asp.net-mvc entity-framework

我有一个多租户应用程序,它将共享相同的数据库。租户通过基于子域的租户ID进行身份验证。

每个用户都有单独的子域来访问应用

  

例如:user1 = test.example.com和User2 = test2.example.com

我想知道获取他们正在访问应用的网址的最佳方法是什么。

  

例如,假设用户像这样访问了应用程序   http://test1.example.com/

     

我想只是" test1.example.com"。

我目前正在使用此

//first 2 forms have 3 controls, last 2 forms have 4 controls.
var form1 = new OrderForm();
var form2 = new OrderForm();
var form3 = new InvoiceForm();
var form4 = new InvoiceForm();

有人能建议最好的方法吗?

0 个答案:

没有答案