Exemple #1
0
        public string GetRelativeCanonicalUrlForTenantEnvironment(FirmaEnvironmentType environmentType, Uri currentUrl)
        {
            string canonicalUrl;

            switch (environmentType)
            {
            case FirmaEnvironmentType.Local:
                canonicalUrl = CanonicalUrlLocal;
                break;

            case FirmaEnvironmentType.Qa:
                canonicalUrl = CanonicalHostNameQa;
                break;

            case FirmaEnvironmentType.Prod:
                canonicalUrl = CanonicalHostNameProd;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(environmentType), environmentType, null);
            }
            return(new UriBuilder(canonicalUrl)
            {
                Path = currentUrl.PathAndQuery
            }.ToString());
        }
Exemple #2
0
        public static string GetRelativeUrlForEnvironment(Uri currentUrl,
                                                          FirmaEnvironmentType firmaEnvironmentType)
        {
            var currentTenant = HttpRequestStorage.Tenant;

            string newHost;

            switch (firmaEnvironmentType)
            {
            case FirmaEnvironmentType.Local:
                newHost = currentTenant.CanonicalHostNameLocal;
                break;

            case FirmaEnvironmentType.Qa:
                newHost = currentTenant.CanonicalHostNameQa;
                break;

            case FirmaEnvironmentType.Prod:
                newHost = currentTenant.CanonicalHostNameProd;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(firmaEnvironmentType), firmaEnvironmentType, null);
            }

            UriBuilder uriBuilder = new UriBuilder
            {
                Scheme = currentUrl.Scheme,
                Host   = newHost,
                Path   = currentUrl.PathAndQuery
            };

            return(uriBuilder.ToString());
        }
Exemple #3
0
        public string GetTenantSquareLogoUrlForEnvironment(FirmaEnvironmentType environmentType)
        {
            switch (environmentType)
            {
            case FirmaEnvironmentType.Local:
                return(new UriBuilder(CanonicalUrlLocal)
                {
                    Path = TenantSquareLogoUrl
                }.ToString());

            case FirmaEnvironmentType.Qa:
                return(new UriBuilder(CanonicalHostNameQa)
                {
                    Path = TenantSquareLogoUrl
                }.ToString());

            case FirmaEnvironmentType.Prod:
                return(new UriBuilder(CanonicalHostNameProd)
                {
                    Path = TenantSquareLogoUrl
                }.ToString());

            default:
                throw new ArgumentOutOfRangeException(nameof(environmentType), environmentType, null);
            }
        }