public void CreateURLTypes()
        {
            var Types = new List <string>
            {
                "Test",       //Used for SAT and ACT test links
                "Scholarship" //Used for Scholarship links
            };

            foreach (var typeName in Types)
            {
                if (!_typeManager.RoleExistsAsync(typeName).Result)
                {
                    var type = new ApplicationURL {
                        Name = typeName
                    };
                    _typeManager.CreateAsync(type).Wait();
                }
            }
        }
Example #2
0
        internal bool UsingHttps()
        {
            if (ApplicationURL != null)
            {
                if (ApplicationURL.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
                {
                    return(true);
                }
            }

            var environmentVariables = (IDictionary <string, string>)EnvironmentVariables;

            if (environmentVariables.TryGetValue("ASPNETCORE_URLS", out string applicationUrls))
            {
                if (applicationUrls != null)
                {
                    return(applicationUrls.IndexOf("https://", StringComparison.OrdinalIgnoreCase) >= 0);
                }
            }

            return(false);
        }