Exemplo n.º 1
0
        private void SetUrl(string url)
        {
            if (url.IsEmpty() && _setupContext.Host().IsEmpty())
            {
                throw new ArgumentException("url must be provided");
            }

            var uri = url.IsNotEmpty()
                ? new Uri(url.FixProtocol())
                : new Uri(new Uri(_setupContext.Host().FixProtocol()), _setupContext.Uri());

            _url = uri.OriginalString;
        }
Exemplo n.º 2
0
        public void SetUrl(string url)
        {
            if (string.IsNullOrEmpty(url) && string.IsNullOrEmpty(_setupContext.Host()))
            {
                throw new ArgumentException("url must be provided");
            }

            var uri = string.IsNullOrEmpty(url)
                ? new Uri(url.FixProtocol(_setupContext.UsesHttps()))
                : new Uri(new Uri(_setupContext.Host().FixProtocol(_setupContext.UsesHttps())), _setupContext.Uri());

            _url = uri.OriginalString;
        }