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; }
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); } }