Esempio n. 1
0
 private string GetTenantName()
 {
     var tennant = new TenantManager(this.RouteData);
     return tennant.GetCurrentTenant();
 }
Esempio n. 2
0
 /// <summary>
 /// 初始化一个新的<c>TenantOwner</c>实例
 /// </summary>
 /// <param name="httpContext">用来获取路由的 Http上下文</param>
 public TenantOwner(HttpContextBase httpContext)
 {
     var routeData = RouteTable.Routes.GetRouteData(httpContext);
     this.tenantManager = new TenantManager(routeData);
 }
Esempio n. 3
0
 /// <summary>
 /// 初始化一个新的<c>TenantOwner</c>实例
 /// </summary>
 /// <param name="route">路由</param>
 public TenantOwner(RouteData route)
 {
     this.tenantManager = new TenantManager(route);
 }
Esempio n. 4
0
 /// <summary>
 /// 初始化一个新的<c>TenantOwner</c>实例。
 /// 使用当前的 HttpContext 对象来获取路由
 /// </summary>
 public TenantOwner()
 {
     var httpContextWrapper = new HttpContextWrapper(HttpContext.Current);
     var routeData = RouteTable.Routes.GetRouteData(httpContextWrapper);
     this.tenantManager = new TenantManager(routeData);
 }