コード例 #1
0
        public void RegionsTest()
        {
            var regionSerice = new MultiRegionHostedSolution("site");

            var t1 = regionSerice.GetTenant("teamlab.com", 50001);
            Assert.AreEqual("alias_test2.teamlab.com", t1.TenantDomain);

            var t2 = regionSerice.GetTenant("teamlab.eu.com", 50001);
            Assert.AreEqual("tscherb.teamlab.eu.com", t2.TenantDomain);
        }
コード例 #2
0
        public void RegionsTest()
        {
            var regionSerice = new MultiRegionHostedSolution("site");

            var t1 = regionSerice.GetTenant("teamlab.com", 50001);

            Assert.AreEqual("alias_test2.teamlab.com", t1.TenantDomain);

            var t2 = regionSerice.GetTenant("teamlab.eu.com", 50001);

            Assert.AreEqual("tscherb.teamlab.eu.com", t2.TenantDomain);
        }
コード例 #3
0
        public SignalRHelper(string domain, string currentAccount, string numberId)
        {
            hubUrl        = ConfigurationManager.AppSettings["hubUrl"] ?? "http://localhost:8884/";
            this.numberId = numberId;

            var multiRegionHostedSolution = new MultiRegionHostedSolution("teamlabsite");

            Tenant           = multiRegionHostedSolution.GetTenant(domain);
            CurrentAccountId = !string.IsNullOrEmpty(currentAccount) ? new Guid(currentAccount) : Tenant.OwnerId;
        }
コード例 #4
0
 public ApiHelper(string domain, string currentAccount)
 {
     try
     {
         var multiRegionHostedSolution = new MultiRegionHostedSolution("teamlabsite");
         Tenant = multiRegionHostedSolution.GetTenant(domain);
         CoreContext.TenantManager.SetCurrentTenant(Tenant);
         CurrentAccountId = !string.IsNullOrEmpty(currentAccount) ? new Guid(currentAccount) : Tenant.OwnerId;
         ApiClient        = new ApiClient(Tenant.GetTenantDomain());
         Cookie           = multiRegionHostedSolution.CreateAuthenticationCookie(Tenant.HostedRegion, Tenant.TenantId, CurrentAccountId);
         SecurityContext.AuthenticateMe(Cookie);
     }
     catch (Exception e)
     {
         Log.ErrorFormat("ApiHelper: StackTrace:{0}, Message: {1}", e.StackTrace, e.Message);
     }
 }