public static IUriBuilder Create(this IUriBuilderFactory uriBuilderFactory, Uri uri)
        {
            if (uriBuilderFactory == null)
            {
                throw new ArgumentNullException(nameof(uriBuilderFactory));
            }

            return(uriBuilderFactory.Create((UriWrapper)uri));
        }
Beispiel #2
0
        private IUriBuilder CreateUriBuilder(Domain domain, string prefix, string command, string responseType)
        {
            var fullCommand             = string.Join("/", new[] { domain.GetParameterName(), prefix, command }.Where(x => !string.IsNullOrEmpty(x)).Select(x => x.TrimEnd('/')));
            var fullCommandWithResponse = string.IsNullOrEmpty(prefix) && string.IsNullOrEmpty(command) ? fullCommand : SetResponseType(fullCommand, responseType);

            var uriBuilder = uriBuilderFactory.Create(fullCommandWithResponse);

            return(uriBuilder.AddCredentials(Credentials, AccessToken));
        }