예제 #1
0
        public ApiUrlBuilder WithTagAndPeriod(string tag, string period)
        {
            MakeSure.ArgumentNotNull(tag, nameof(tag));
            MakeSure.ArgumentNotNull(period, nameof(period));

            _apiUrl = _apiUrl + $"{tag}/{period}";
            return(this);
        }
예제 #2
0
        public ApiUrlBuilder WithIds(List <string> ids, string route = "")
        {
            MakeSure.ArgumentNotNullOrEmptyEnumerable(ids, nameof(ids));
            var idsToEncode = string.Join(";", ids.ToArray());

            if (string.IsNullOrEmpty(route) || string.IsNullOrWhiteSpace(route))
            {
                _apiUrl = _apiUrl + $"{HttpUtility.UrlEncode(idsToEncode)}";
            }
            else
            {
                _apiUrl = _apiUrl + $"{HttpUtility.UrlEncode(idsToEncode)}/{route}";
            }
            return(this);
        }
예제 #3
0
        public ApiUrlBuilder WithFilter(Filter filter, string inName = "")
        {
            MakeSure.ArgumentNotNull(filter, nameof(filter));

            if (string.IsNullOrEmpty(inName) || string.IsNullOrWhiteSpace(inName))
            {
                _filter = filter.GetQueryParams();
            }
            else
            {
                _filter = $"{filter.GetQueryParams()}&inname={inName}";
            }

            return(this);
        }