private string GetTenantName() { var tennant = new TenantManager(this.RouteData); return tennant.GetCurrentTenant(); }
/// <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); }
/// <summary> /// 初始化一个新的<c>TenantOwner</c>实例 /// </summary> /// <param name="route">路由</param> public TenantOwner(RouteData route) { this.tenantManager = new TenantManager(route); }
/// <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); }